Perseus Vault persistent, local, encrypted memory for Pydantic AI agents — exposed as a Toolset.
Project description
pydantic-ai-perseus-vault
Persistent, local-first, encrypted memory for Pydantic AI agents — backed by Perseus Vault (formerly "Mimir"/"Mneme").
PerseusVaultToolset gives a Pydantic AI Agent durable memory that survives across
runs and processes. Your agent can perseus_vault_remember facts and perseus_vault_recall
them later, with full-text + semantic search, all stored in a local SQLite
database that never leaves the machine (and can be AES-256-GCM encrypted at
rest).
Tool names. Perseus Vault exposes its MCP tools under three aliased prefixes —
perseus_vault_*(canonical), plusmimir_*andmneme_*kept for backward compatibility. This package uses the canonicalperseus_vault_*names throughout.
Why this package?
Pydantic AI already speaks the Model Context Protocol natively via
MCPToolset, and Perseus Vault is an MCP stdio
server — so you could wire them together by hand. PerseusVaultToolset is the
ergonomic shortcut: it subclasses MCPToolset, resolves the perseus-vault binary,
manages the database path, optionally enables encryption, and spawns
perseus-vault serve for you. One line instead of a transport assembly. Because it
is an MCPToolset, every Pydantic AI MCP feature (tool caching,
include_instructions, process_tool_call, tool filtering/renaming) works
unchanged.
Prerequisite: the perseus-vault binary
Perseus Vault is a single self-contained binary. Install it and make sure it is on your
PATH:
# One-line install (installs to ~/.local/bin/perseus-vault):
curl -sSf https://raw.githubusercontent.com/Perseus-Computing-LLC/perseus-vault/main/scripts/install.sh | sh
# ...or build from source (Rust toolchain required):
git clone https://github.com/Perseus-Computing-LLC/perseus-vault
cd perseus-vault && cargo build --release
# then put target/release/perseus-vault on your PATH
# ...or download a prebuilt binary from the releases page:
# https://github.com/Perseus-Computing-LLC/perseus-vault/releases
Verify:
perseus-vault --version
Install
pip install pydantic-ai-perseus-vault
This pulls in pydantic-ai-slim[mcp]. If you already use the full
pydantic-ai, that satisfies the dependency too.
Usage
import asyncio
from pydantic_ai import Agent
from pydantic_ai_perseus_vault import PerseusVaultToolset
# Spawns `perseus-vault serve --db ~/.mimir/agent.db` and exposes its memory tools.
memory = PerseusVaultToolset(db_path="~/.mimir/agent.db")
agent = Agent(
"openai:gpt-5",
toolsets=[memory],
instructions=(
"You have a persistent memory. Use perseus_vault_remember to store "
"durable facts about the user, and perseus_vault_recall to look them "
"up before answering."
),
)
async def main() -> None:
async with agent: # opens the MCP connection for the agent's lifetime
await agent.run("My favourite colour is teal. Please remember that.")
result = await agent.run("What's my favourite colour?")
print(result.output) # -> teal
asyncio.run(main())
Encryption at rest
memory = PerseusVaultToolset(
db_path="~/.mimir/agent.db",
encryption_key="~/.mimir/key.b64", # base64-encoded 32-byte AES-256-GCM key
)
Custom binary location
memory = PerseusVaultToolset(
db_path="~/.mimir/agent.db",
perseus_vault_binary="/opt/perseus-vault/bin/perseus-vault", # explicit path; otherwise resolved from PATH
)
Passing through MCPToolset options
Any MCPToolset keyword is forwarded:
memory = PerseusVaultToolset(
db_path="~/.mimir/agent.db",
id="perseus-vault-memory", # stable id (needed for Temporal/DBOS durability)
include_instructions=True, # inject Perseus Vault's server instructions into the agent
cache_tools=True,
)
What tools does the agent get?
All of Perseus Vault's MCP tools (exposed under the canonical perseus_vault_*
prefix), including:
| Tool | Purpose |
|---|---|
perseus_vault_remember |
Store a durable memory (category, key, body, tags) |
perseus_vault_recall |
Hybrid full-text + semantic search over memories |
perseus_vault_get_entity |
Fetch a specific memory by id/key |
perseus_vault_timeline |
Time-ordered view of memories |
perseus_vault_forget / perseus_vault_supersede |
Delete or replace memories |
perseus_vault_link / perseus_vault_traverse |
Relate and walk between memories |
| ... | and many more (stats, journaling, vault import/export, etc.) |
The exact set depends on your installed Perseus Vault version.
Development
pip install -e ".[test]"
pytest
The unit tests mock the subprocess and run with no perseus-vault binary installed. A
real end-to-end smoke test runs automatically when a perseus-vault binary is on
PATH, and is skipped otherwise.
License
MIT © 2026 Perseus Computing LLC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_ai_perseus_vault-0.1.0.tar.gz.
File metadata
- Download URL: pydantic_ai_perseus_vault-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad98b18f483380d8d754c0d8f9f2270bdb5e54d8dd9d18602b956b7c39d4221f
|
|
| MD5 |
c30db74b1454eaf66eb0261512011910
|
|
| BLAKE2b-256 |
4e86bd24806c9ab58ae749c2d46575ffba0456f56d015dd69ea3521fcd0960be
|
Provenance
The following attestation bundles were made for pydantic_ai_perseus_vault-0.1.0.tar.gz:
Publisher:
publish.yml on Perseus-Computing-LLC/pydantic-ai-mimir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_ai_perseus_vault-0.1.0.tar.gz -
Subject digest:
ad98b18f483380d8d754c0d8f9f2270bdb5e54d8dd9d18602b956b7c39d4221f - Sigstore transparency entry: 2072281572
- Sigstore integration time:
-
Permalink:
Perseus-Computing-LLC/pydantic-ai-mimir@05b1992f29a9fb1ca0f73fa384af661469549da2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Perseus-Computing-LLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05b1992f29a9fb1ca0f73fa384af661469549da2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pydantic_ai_perseus_vault-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydantic_ai_perseus_vault-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c20c13923569641a3cb6d59bf254da904b5ee6158d0a4338c727b8f7ce91c19c
|
|
| MD5 |
915b5441217124d9ad20ef8a02ab41e8
|
|
| BLAKE2b-256 |
4d7e04c1ee975e72ae922671460f06c28726f8cc15779a4510ff26cb6d0ca790
|
Provenance
The following attestation bundles were made for pydantic_ai_perseus_vault-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Perseus-Computing-LLC/pydantic-ai-mimir
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydantic_ai_perseus_vault-0.1.0-py3-none-any.whl -
Subject digest:
c20c13923569641a3cb6d59bf254da904b5ee6158d0a4338c727b8f7ce91c19c - Sigstore transparency entry: 2072281682
- Sigstore integration time:
-
Permalink:
Perseus-Computing-LLC/pydantic-ai-mimir@05b1992f29a9fb1ca0f73fa384af661469549da2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Perseus-Computing-LLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@05b1992f29a9fb1ca0f73fa384af661469549da2 -
Trigger Event:
workflow_dispatch
-
Statement type: