Skip to content

Installation

import { Aside } from ‘@astrojs/starlight/components’;

SQLite topology-a (embedded, single-agent)

Section titled “SQLite topology-a (embedded, single-agent)”

The mempill facade crate re-exports mempill-core and mempill-sqlite for the most common embedded case:

Cargo.toml
[dependencies]
mempill = "0.3"
tokio = { version = "1", features = ["full"] }

Or add individual crates:

Terminal window
cargo add mempill

PostgreSQL topology-b (multi-agent shared database)

Section titled “PostgreSQL topology-b (multi-agent shared database)”
Cargo.toml
[dependencies]
mempill-postgres = "0.3"
mempill-core = "0.3"
tokio = { version = "1", features = ["full"] }

Or with cargo-add:

Terminal window
cargo add mempill-postgres mempill-core
  • Rust 1.88 or later (MSRV, edition 2021)
  • Tokio async runtime
  • For PostgreSQL topology-b: a running PostgreSQL 16+ instance

The Python wheel mempill is published on PyPI and requires Python 3.11 or later. The published version is 0.3.0; it does not yet include the 0.4.0 per-agent entry points (open_for_agent, open_oracle_for_agent) used in this site’s examples.

Terminal window
pip install mempill

mempill-mcp is not on PyPI. It also depends on the 0.4.0 open_for_agent entry point, so until 0.4.0 is published, install both packages from a local source build rather than mixing a PyPI wheel with the main-branch MCP adapter (a pip install mempill + MCP-from-main combination will fail at startup — the wheel lacks the entry point the adapter calls):

Terminal window
# 1. Build and install the mempill wheel from source (0.4.0, main branch)
cd mempill/mempill-python
maturin develop --release
# 2. Install the MCP adapter from source into the same virtual environment
cd ../mempill-mcp
pip install .

Once 0.4.0 is published to PyPI, step 1 collapses back to pip install mempill.

Run the MCP server:

Terminal window
export MEMPILL_AGENT_ID="my-agent"
export MEMPILL_DB_DIR="/path/to/data" # omit for in-memory (ephemeral)
mempill-mcp

The database file is derived automatically as MEMPILL_DB_DIR/agent_{MEMPILL_AGENT_ID}.db.

Terminal window
cargo check
import mempill
engine = mempill.open_in_memory()
print("mempill ready:", engine)
# mempill ready: <builtins.PyEngine object at 0x...>