polypack-mcp
This server provides persistent, adaptive memory for MCP clients via Polypack, with tools to store, retrieve, manage, link, and reason over memories.
Store memories in four classes (entity, episodic, procedural, semantic), including batch storage.
Retrieve memories by semantic/lexical/activation search (
memory_recall) or assemble a working-memory context under a token budget (memory_context).Inspect memories with exact ID lookup (
memory_get) and list available context namespaces (memory_list_contexts).Update mutable fields like context, confidence, provenance, and metadata without changing content (
memory_update).Remove memories permanently with confirmation (
memory_delete) or suppress them while retaining history (memory_suppress).Replace outdated content while keeping history via supersession (
memory_supersede).Consolidate multiple source memories into a higher-level durable memory (
memory_consolidate).Link memories with graph relationships such as RESPONDS_TO, in single or batch operations (
memory_link,memory_link_batch,memory_unlink).Walk threads of linked memories chronologically (
memory_thread).Query the graph for neighbors, schema, edge operations, and relationship diagnostics (
graph_query).Give feedback on retrieval usefulness to reinforce or dampen activation (
memory_feedback).Enable optional semantic retrieval with a local Qwen embedding helper, with automatic fallback to lexical+activation scoring if unavailable.
Run as a local MCP server over stdio or Streamable HTTP, with durable store support, systemd service setup, and Debian/RPM packaging for shared multi-client use.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@polypack-mcp What do you remember about the project onboarding?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
An MCP server that exposes Polypack as persistent adaptive memory. MCP-specific tools live here; the database remains an independent dependency.
Install and run
The simplest installation is from PyPI:
python3 -m pip install 'polypack-mcp[polypack]'For one MCP client, use the default stdio server configuration. For Claude and Codex sharing the same durable memory, install once and create a long-running user service:
polypack-mcp setup --store ~/.local/share/polypack-mcpThis starts a stateless Streamable HTTP server at http://127.0.0.1:8765/mcp/, restarts it after a
failure, and prints client configuration snippets. The setup command uses
systemd --user; on systems without systemd, start the server directly:
polypack-mcp --transport streamable-http --port 8765 --store ~/.local/share/polypack-mcpIn shared Streamable HTTP mode, configure both clients with the URL. Do not configure them
with a command and --store, since that starts two processes competing for
the same durable store.
Codex (~/.codex/config.toml):
[mcp_servers.polypack]
url = "http://127.0.0.1:8765/mcp/"Claude Desktop:
{
"mcpServers": {
"polypack": { "url": "http://127.0.0.1:8765/mcp/" }
}
}Debian package
The Debian package installs and starts a system-level polypack-mcp service
automatically. It runs as the dedicated polypack user, stores data in
/var/lib/polypack-mcp, and exposes the same local Streamable HTTP endpoint:
sudo apt install ./polypack-mcp_<version>_amd64.debAfter installation, point Claude and Codex at
http://127.0.0.1:8765/mcp/. The default port can be changed in
/etc/default/polypack-mcp, followed by a service restart. The service can be
managed with:
sudo systemctl status polypack-mcp
sudo systemctl restart polypack-mcpThe PyPI installation remains user-managed and uses polypack-mcp setup to
create a per-user service instead.
Optional semantic retrieval
The default installation uses Polypack's local graph, activation, and lexical retrieval without downloading an AI model. To enable local Qwen semantic retrieval, run:
sudo polypack-mcp embeddings setup qwen3 --system --store /var/lib/polypack-mcpThis creates a managed localhost helper, downloads Qwen once into the store's embedding cache, and reindexes existing memories. The model is not bundled in the Debian/RPM package.
The helper loads Qwen3-Embedding-0.6B in bfloat16 (~1GB resident once loaded,
versus ~2.4GB in fp32) and unloads it after 15 minutes of inactivity,
reloading automatically on the next request. memory_recall results include
a semantic entry in scoreComponents whenever the helper is reachable,
alongside lexical and activation — the three sum to the reported score.
If the helper is stopped or errors, recall falls back to lexical + activation
scoring automatically. Check or disable it with:
polypack-mcp embeddings status
sudo polypack-mcp embeddings disable --system --store /var/lib/polypack-mcpFor a PyPI user service, omit sudo --system and use the user store:
polypack-mcp embeddings setup qwen3APT repository
The latest Debian package is also published to the public APT repository at
https://imattau.github.io/polypack-mcp. Configure it with the repository's
signing key, then install and update normally:
curl -fsSL https://imattau.github.io/polypack-mcp/gpg.key \
| sudo gpg --dearmor -o /usr/share/keyrings/polypack-mcp.gpg
echo "deb [signed-by=/usr/share/keyrings/polypack-mcp.gpg] https://imattau.github.io/polypack-mcp stable main" \
| sudo tee /etc/apt/sources.list.d/polypack-mcp.list
sudo apt update
sudo apt install polypack-mcpThe repository is updated automatically for each v*.*.* release tag. See
docs/apt-repository.md for maintainer setup instructions.
RPM package
RPM-based distributions can install from the public RPM repository:
sudo rpm --import https://imattau.github.io/polypack-mcp/rpm/RPM-GPG-KEY-polypack-mcp
sudo tee /etc/yum.repos.d/polypack-mcp.repo >/dev/null <<'EOF'
[polypack-mcp]
name=Polypack MCP
baseurl=https://imattau.github.io/polypack-mcp/rpm/
enabled=1
gpgcheck=1
gpgkey=https://imattau.github.io/polypack-mcp/rpm/RPM-GPG-KEY-polypack-mcp
EOF
sudo dnf install polypack-mcpThe matching .rpm asset is also attached to the
GitHub release:
sudo dnf install ./polypack-mcp-<version>-1.x86_64.rpmThe RPM package provides the same systemd service, store location, localhost Streamable HTTP endpoint, and Python 3.12 requirement as the Debian package.
Related MCP server: Memory Server MCP
Run manually
pip install -e '.[polypack]'
polypack-mcp --store ./polypack-dataThe server exposes seventeen focused tools: memory_store, memory_get,
memory_update, memory_list_contexts, memory_delete, memory_recall,
memory_context, memory_feedback, memory_suppress, memory_supersede,
memory_consolidate, memory_link, memory_unlink, memory_thread,
memory_store_batch, memory_link_batch, and graph_query. It also publishes context,
active-memory, schema, stats, and agent workflow guidance resources under
polypack://.
Memory classes are entity, episodic, procedural, and semantic. Store
project or user preferences as procedural memories; preference is not a
separate memory class.
When using a durable Polypack store, mutating operations checkpoint immediately and the server flushes the store during shutdown.
Retrieval tools return {items, metadata}. Metadata includes candidate and
excluded counts, context matches, score components, fallback behavior, the
retrieval version, and selection statistics. memory_context uses estimated
tokens (ceil(content characters / 4), minimum one) as its token_budget.
An item is never returned if it would exceed the remaining budget; budgets less
than or equal to zero are rejected. Context is a soft preference: matching
memories are preferred and unscoped global memories may be used as fallback.
Pass strict_context: true for isolation. An empty isolated result reports
reason: "no_context_match" and the searched context.
memory_recall can optionally hydrate related graph memories in the same call:
{
"query": "identity cache fix",
"context": "cross-agent",
"include_neighbors": true,
"edge_types": ["RESPONDS_TO"],
"depth": 2,
"neighbor_limit": 3,
"limit": 20,
"token_budget": 4000
}Neighbor traversal is opt-in and bounded. limit caps the total response and
neighbor_limit caps hydrated neighbors; metadata reports
moreNeighborsAvailable when additional eligible neighbors were found. Neighbor
items include their distance and connecting relationship metadata. Use
memory_link with the default
RESPONDS_TO relationship for handoffs, reviews, and fixes that address an
earlier memory. Graph edges are authoritative for relationships; use
graph_query(operation="relationship_diagnostics") to find legacy
provenance.responds_to values that are not backed by edges. See
polypack://help/workflow for the agent-facing workflow.
Feedback is activation feedback: useful=true reinforces a memory and
useful=false provides negative retrieval feedback. Responses expose activation
before and after plus whether learned weights changed. Supersession and
consolidation materialize SUPERSEDES, SUPERSEDED_BY, and
CONSOLIDATED_FROM graph edges.
Use memory_get for exact ID lookup and memory_update for mutable fields
(context, confidence, provenance, and metadata). Content changes should use
memory_supersede so history remains intact. Use memory_unlink to correct a
relationship and memory_list_contexts to discover namespaces. memory_delete
is permanent, requires confirm=true, and supports an optional revision check;
prefer memory_suppress when retaining history is useful.
Pass --store to open a durable Polypack directory. Without it, the server uses
the in-memory reference backend, which is convenient for smoke tests.
The polypack extra requires polypack-db>=3.3.1 and uses its native
ActivationEngine.working_memory selector for context assembly.
Development
pip install -e '.[dev]'
pytestThe test suite includes an MCP client/server protocol smoke test covering tool discovery, memory storage, recall, and resource reads.
Documentation
Available Tools
18 toolsgraph_queryB
Inspect graph neighbors/schema or perform an advanced edge operation.
Prefer memory_link for normal memory relationships. Supported operations are neighbors, add_edge, schema, and relationship_diagnostics. RESPONDS_TO graph edges are authoritative; diagnostics identifies legacy provenance-only relationships.
Inputs: operation (required), id, type, source, +1 more.
memory_consolidateC
Consolidate source memories into one durable higher-level memory.
Inputs: content (required), source_ids (required), context, confidence, +1 more.
memory_contextB
Return a working-memory set selected by activation and estimated-token budget.
token_budget is an estimated-token budget. Each returned memory fits wholly within the remaining budget; budgets must be greater than zero.
Inputs: context (required), limit, token_budget, strict_context.
memory_deleteA
Permanently delete one memory and its graph edges.
This destructive operation requires confirm=true. Prefer memory_suppress when retaining history is useful.
Inputs: memory_id (required), confirm, expected_revision.
memory_feedbackB
Record whether a retrieved memory helped this task.
Call this after using a recalled memory when it was useful or misleading.
Inputs: useful (required), memory_id (required), agent_id.
memory_getA
Fetch one memory by exact ID, including its current state and revision.
Inputs: memory_id (required).
memory_linkA
Connect two memories with an explicit graph relationship.
Use RESPONDS_TO when a new handoff, verification, or fix addresses an earlier memory. Use memory_recall(include_neighbors=true) to retrieve linked memories with relationship metadata.
Inputs: source_memory_id (required), target_memory_id (required), relationship.
memory_link_batchB
Connect multiple pairs of memories with explicit graph relationships in a single batch.
Each item in the list should be a dict with 'source_memory_id', 'target_memory_id', and optional 'relationship' (defaults to 'RESPONDS_TO') keys.
Inputs: links (required).
memory_list_contextsA
List context namespaces and the number of memories in each.
Inputs: no named parameters.
memory_recallA
Search memories by text, context, activation, and confidence.
Use this for a targeted question. Use memory_context to assemble working context. Context is soft by default; use strict_context=true for isolation. With include_neighbors=true, bounded graph neighbors are hydrated into the result. Filter relationships with edge_types such as RESPONDS_TO. The neighbor_limit bounds hydrated neighbors; limit remains the total result count. depth is silently clamped to at most 3 hops regardless of the value passed; metadata reports the depth actually applied. Metadata also reports when additional neighbors were available.
Inputs: query (required), depth, limit, context, +5 more.
memory_storeB
Store durable project memory.
Use procedural for preferences, conventions, and decisions; semantic for stable facts; episodic for events or task outcomes; and entity for named people, projects, or objects. Use a stable context for project memory.
Inputs: content (required), context, metadata, confidence, +2 more.
memory_store_batchA
Store multiple durable project memories in a single batch.
Each item in the list should be a dict with 'content' and optional 'memory_class', 'context', 'confidence', 'provenance', and 'metadata' keys.
Inputs: memories (required).
memory_store_with_linkA
Store a new memory and link it to an existing memory in one call.
Combines memory_store and memory_link for the common case of storing a reply, verification, or fix that responds to an earlier memory. By default the new memory is the link source (new -relationship-> target); set reverse=true to make the new memory the link target instead.
Inputs: content (required), target_memory_id (required), context, reverse, +5 more.
memory_supersedeA
Replace an outdated fact while retaining its history.
Inputs: new_memory_id (required), old_memory_id (required).
memory_suppressC
Inhibit a stale or unhelpful memory without deleting it.
Inputs: memory_id (required), amount.
memory_threadB
Walk the RESPONDS_TO chain from a starting memory ID and return the thread.
Retrieves connected memories in both directions along RESPONDS_TO edges, returning them sorted chronologically.
Inputs: start_id (required), max_depth.
memory_unlinkA
Remove graph edges between two memories.
If relationship is omitted, all directed edges from source to target are removed.
Inputs: source_memory_id (required), target_memory_id (required), relationship.
memory_updateA
Update mutable memory fields without changing its content.
Supported fields are context, confidence, provenance, and metadata. Use memory_supersede when the memory content itself needs to change. expected_revision prevents overwriting a concurrent update.
Inputs: patch (required), memory_id (required), expected_revision.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a clearly distinct role: store, link, retrieve, suppress, supersede, consolidate, batch, and graph diagnostics are all explicitly separated. Even near-overlapping pairs like memory_store/memory_store_with_link and memory_link/graph_query are carefully disambiguated in their descriptions.
The memory_* prefix provides a strong, predictable namespace, and most tools follow a clear verb-like pattern: store, update, delete, recall, link, unlink. Minor deviations like memory_context, memory_thread, and memory_feedback are noun-oriented, and graph_query breaks the memory_ prefix pattern, so it is not perfectly uniform.
At 18 tools, the server is above the ideal 3-15 range and feels somewhat heavy. However, the batch variants, store-with-link convenience, and full memory lifecycle tools are mostly justified by the breadth of the domain.
The tool surface covers memory CRUD, batch operations, graph edge management, retrieval modes, lifecycle transitions, feedback, and context assembly. There are no obvious dead ends or missing operations for a project-memory and relationship-graph server.
Maintenance
Related MCP Connectors
Persistent AI memory with semantic search, conflict detection, and ticketing.
Persistent memory layer for AI clients: store, recall, and correct context across tools.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory for AI agents: add, search, update, and delete long-term memories.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides AI with persistent memory management including short-term memory (FIFO queue), long-term memory (graph-based storage with associations), and thought process management with multiple cognitive modes for continuous learning and reasoning.243MIT
- AlicenseAqualityDmaintenanceProvides persistent memory storage with advanced features like tagging, content search, and expiration settings. It enables users to create directed links between stored memories to build structured relationships and knowledge graphs.128 npmISC
- FlicenseBqualityDmaintenanceEnables persistent memory for AI systems by providing tools for episodic, semantic, and procedural data storage through a vector-and-graph-enhanced database. It allows models to maintain long-term continuity using similarity search, thematic clustering, and identity tracking.241-

JauMemory MCP Serverofficial
AlicenseAqualityDmaintenanceProvides persistent memory capabilities for AI assistants, enabling storage, recall, and analysis of information across conversations with intelligent memory management.2510 npmMIT