Skip to content
This page was generated and translated with the assistance of AI. If you spot any inaccuracies, feel free to help improve it. Edit on GitHub

PRX-Memory

PRX-Memory is a local-first semantic memory engine designed for coding agents. It combines embedding-based retrieval, reranking, governance controls, and measurable evolution into a single MCP-compatible component. PRX-Memory ships as a standalone daemon (prx-memoryd) that communicates over stdio or HTTP, making it compatible with Codex, Claude Code, OpenClaw, OpenPRX, and any other MCP client.

PRX-Memory focuses on reusable engineering knowledge, not raw logs. The system stores structured memories with tags, scopes, and importance scores, then retrieves them using a combination of lexical search, vector similarity, and optional reranking -- all governed by quality and safety constraints.

Why PRX-Memory?

Most coding agents treat memory as an afterthought -- flat files, unstructured logs, or vendor-locked cloud services. PRX-Memory takes a different approach:

  • Local-first. All data stays on your machine. No cloud dependency, no telemetry, no data leaving your network.
  • Structured and governed. Every memory entry follows a standardized format with tags, scopes, categories, and quality constraints. Tag normalization and ratio bounds prevent drift.
  • Semantic retrieval. Combine lexical matching with vector similarity and optional reranking to find the most relevant memories for a given context.
  • Measurable evolution. The memory_evolve tool uses train/holdout splits and constraint gating to accept or reject candidate improvements -- no guesswork.
  • MCP native. First-class support for the Model Context Protocol over stdio and HTTP transports, with resource templates, skill manifests, and streaming sessions.

Key Features

  • Multi-Provider Embedding -- Supports OpenAI-compatible, Jina, and Gemini embedding providers through a unified adapter interface. Switch providers by changing an environment variable.

  • Reranking Pipeline -- Optional second-stage reranking using Jina, Cohere, or Pinecone rerankers to improve retrieval precision beyond raw vector similarity.

  • Governance Controls -- Structured memory format with tag normalization, ratio bounds, periodic maintenance, and quality constraints ensure memory quality stays high over time.

  • Memory Evolution -- The memory_evolve tool evaluates candidate changes using train/holdout acceptance testing and constraint gating, providing measurable improvement guarantees.

  • Dual Transport MCP Server -- Run as a stdio server for direct integration or as an HTTP server with health checks, Prometheus metrics, and streaming sessions.

  • Skill Distribution -- Built-in governance skill packages discoverable through MCP resource and tool protocols, with payload templates for standardized memory operations.

  • Observability -- Prometheus metrics endpoint, Grafana dashboard templates, configurable alert thresholds, and cardinality controls for production deployments.

Architecture

mermaid
graph TB
    CLIENT["MCP Client<br/>Codex | Claude Code | OpenClaw"]

    subgraph Transport["Transport Layer"]
        STDIO["stdio Transport"]
        HTTP["HTTP Transport<br/>Health | Metrics | SSE"]
    end

    subgraph Engine["Memory Engine"]
        GOVERN["Governance Layer<br/>Tag Normalization | Ratio Bounds | Quality Constraints"]
        RETRIEVE["Retrieval Layer<br/>Lexical Search | Vector Similarity"]
        RERANK["Rerank Layer<br/>Jina | Cohere | Pinecone"]
        EVOLVE["Evolution Layer<br/>Train/Holdout | Constraint Gating"]
    end

    subgraph Providers["AI Providers"]
        EMBED["Embedding Providers<br/>OpenAI-compatible | Jina | Gemini"]
        RERANKP["Rerank Providers<br/>Jina | Cohere | Pinecone"]
    end

    subgraph Storage["Storage"]
        JSON["JSON Backend<br/>File-based"]
        SQLITE["SQLite + Vector<br/>Local persistent"]
    end

    CLIENT --> STDIO
    CLIENT --> HTTP
    STDIO --> GOVERN
    HTTP --> GOVERN
    GOVERN --> RETRIEVE
    RETRIEVE --> RERANK
    RERANK --> EVOLVE
    RETRIEVE --> EMBED
    RERANK --> RERANKP
    GOVERN --> JSON
    GOVERN --> SQLITE

Quick Start

Build and run the memory daemon:

bash
cargo build -p prx-memory-mcp --bin prx-memoryd

PRX_MEMORYD_TRANSPORT=stdio \
PRX_MEMORY_DB=./data/memory-db.json \
./target/debug/prx-memoryd

Or install via Cargo:

bash
cargo install prx-memory-mcp

See the Installation Guide for all methods and configuration options.

Workspace Crates

CrateDescription
prx-memory-coreCore scoring and evolution domain primitives
prx-memory-embedEmbedding provider abstraction and adapters
prx-memory-rerankRerank provider abstraction and adapters
prx-memory-aiUnified provider abstraction for embeddings and rerank
prx-memory-skillBuilt-in governance skill payloads
prx-memory-storageLocal persistent storage engine (JSON, SQLite, LanceDB)
prx-memory-mcpMCP server surface with stdio and HTTP transports

Documentation Sections

SectionDescription
InstallationBuild from source or install via Cargo
Quick StartGet PRX-Memory running in 5 minutes
Embedding EngineEmbedding providers and batch processing
Supported ModelsOpenAI-compatible, Jina, Gemini models
Reranking EngineSecond-stage reranking pipeline
Storage BackendsJSON, SQLite, and vector search
MCP IntegrationMCP protocol, tools, resources, and templates
Rust API ReferenceLibrary API for embedding PRX-Memory in Rust projects
ConfigurationAll environment variables and profiles
TroubleshootingCommon issues and solutions

Project Info

  • License: MIT OR Apache-2.0
  • Language: Rust (2024 edition)
  • Repository: github.com/openprx/prx-memory
  • Minimum Rust: stable toolchain
  • Transports: stdio, HTTP

Released under the Apache-2.0 License.