Skip to content

prx-memory

prx-memory is a Rust MCP server that gives AI agents persistent, searchable memory. Agents store learnings during task execution and recall them in future sessions, enabling knowledge accumulation across the entire pipeline.

prx-memory supports two MCP transports:

TransportUse Case
stdioDirect integration with CLI agents (claude-code, codex)
HTTPNetwork-accessible server for multi-agent deployments (requires --features http)

prx-memory exposes 14 MCP tools:

ToolDescription
storeStore a new memory entry with content, tags, and importance score
recallRetrieve memories by semantic similarity, keyword match, or tag filter
updateModify an existing memory’s content, tags, or importance
forgetSoft-delete a memory (recoverable)
listList memories with pagination and filtering
statsReturn memory store statistics (count, tag distribution, storage size)
ToolDescription
store_dualStore a memory with both a concise summary and full content
exportExport all memories to JSON for backup or migration
importImport memories from a JSON export
migrateMigrate memory store schema to a new version
ToolDescription
reembedRegenerate embeddings for all memories (after switching embedding provider)
compactMerge duplicate or near-duplicate memories to reduce store size
evolveTrigger MSES self-evolution cycle (see below)
skill_manifestReturn a structured manifest of all tools and their parameters

When an agent calls recall, prx-memory runs a multi-signal retrieval pipeline:

Query
├── BM25 keyword search (sparse)
├── Cosine similarity on embeddings (dense)
Score fusion
├── Recency boost (newer memories score higher)
├── Importance weighting (user-assigned importance)
├── Deduplication (near-duplicate suppression)
Optional reranking
Top-K results

When enabled, retrieved candidates are reranked by a dedicated model for higher precision:

ProviderNotes
Jina RerankerJina AI reranking API
Cohere RerankCohere’s reranking endpoint
Pinecone RerankPinecone’s inference API

Reranking is optional and disabled by default. Enable it when recall precision is more important than latency.

prx-memory generates vector embeddings for semantic search. Supported providers:

ProviderModelsNotes
OpenAI-compatibletext-embedding-3-small, text-embedding-3-large, or any compatible endpointDefault; works with OpenAI, Azure, local servers
Jinajina-embeddings-v3Jina AI’s embedding API
Geminitext-embedding-004Google’s embedding model

Configure the provider and model in the configuration file. If you switch providers, run the reembed tool to regenerate all existing embeddings.

The Memory Self-Evolution System (MSES) optimizes retrieval parameters automatically:

  1. Candidate selection — Choose a parameter to evolve (e.g., BM25 weight, recency decay, similarity threshold)
  2. Train set scoring — Evaluate candidates against a training set of known-good query/result pairs
  3. Holdout scoring — Validate the best candidate against a held-out test set to prevent overfitting
  4. Apply or reject — If the holdout score improves, the new parameter is adopted; otherwise, the current value is retained

Trigger evolution manually via the evolve MCP tool, or configure it to run on a schedule.

prx-memory includes governance controls for multi-agent and multi-team deployments:

Define naming conventions and content standards that all stored memories must follow. Memories that violate the active profile are rejected or auto-corrected.

Enforce a controlled vocabulary for memory tags. Free-form tags can be mapped to canonical tags automatically.

Set minimum and maximum ratios for memory categories (e.g., “at least 10% of memories must be error patterns”, “no more than 50% can be code snippets”). This prevents the store from becoming dominated by a single category.

Control which agents or users can read/write specific memory scopes. Scopes partition the memory store so that project-specific knowledge does not leak across boundaries.

[storage]
path = "~/.prx-memory/store.db"
[embedding]
provider = "openai"
model = "text-embedding-3-small"
api_key_env = "OPENAI_API_KEY"
[retrieval]
bm25_weight = 0.3
semantic_weight = 0.7
recency_half_life_days = 30
top_k = 10
[reranker]
enabled = false
provider = "jina"
[evolution]
enabled = false
schedule = "weekly"
Terminal window
# stdio mode (for direct agent integration)
cargo run --release
# HTTP mode (network-accessible)
cargo run --release --features http
# With custom config
cargo run --release -- --config /etc/prx-memory/config.toml