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

Storage Backends ​

PRX-Memory supports multiple storage backends for persisting memories and their vector embeddings. The prx-memory-storage crate provides a unified interface that all backends implement.

Available Backends ​

BackendConfig ValueVector SupportPersistenceBest For
JSONjsonEmbedded in entriesFile-basedDevelopment, small datasets
SQLitesqliteBuilt-in vector columnsFile-basedProduction, medium datasets
LanceDBlancedbNative vector indexDirectory-basedLarge datasets, fast ANN search

Default Backend

The default backend is JSON (PRX_MEMORY_BACKEND=json), which requires no additional setup. For production deployments, SQLite is recommended.

JSON Backend ​

The simplest backend stores all memories in a single JSON file. It is ideal for development, testing, and small memory sets (under 10,000 entries).

bash
PRX_MEMORY_BACKEND=json
PRX_MEMORY_DB=./data/memory-db.json

Advantages:

  • Zero setup -- just specify a file path.
  • Human-readable -- inspect and edit with any text editor.
  • Portable -- copy the file to move your entire memory database.

Limitations:

  • Entire file is loaded into memory on startup.
  • Write operations rewrite the full file.
  • No indexed vector search -- brute-force scan for similarity.

SQLite Backend ​

SQLite provides ACID transactions, indexed queries, and built-in vector column support for efficient similarity search.

bash
PRX_MEMORY_BACKEND=sqlite
PRX_MEMORY_DB=./data/memory.db

See SQLite Storage for detailed configuration.

LanceDB Backend (Optional) ​

LanceDB provides native approximate nearest neighbor (ANN) vector search with columnar storage. Enable it with the lancedb-backend feature flag:

bash
cargo build --release -p prx-memory-mcp --bin prx-memoryd --features lancedb-backend
bash
PRX_MEMORY_BACKEND=lancedb
PRX_MEMORY_DB=./data/lancedb

Feature Flag Required

LanceDB support is not included in the default build. You must enable the lancedb-backend feature flag at compile time.

Choosing a Backend ​

ScenarioRecommended Backend
Local developmentJSON
Production with <100k entriesSQLite
Production with >100k entriesLanceDB
Need human-readable storageJSON
Need ACID transactionsSQLite
Need fast ANN vector searchLanceDB

Storage Operations ​

PRX-Memory provides tools for storage maintenance:

ToolDescription
memory_exportExport all memories to a portable format
memory_importImport memories from an export
memory_migrateMigrate between storage backends
memory_compactOptimize storage and reclaim space
memory_reembedRe-embed all memories with a new model

Next Steps ​

Released under the Apache-2.0 License.