Skip to main content

Perseus Vault persistent, local, encrypted memory for LangChain — tools and a retriever backed by the Perseus Vault MCP engine.

Project description

langchain-perseus-vault

Persistent, local-first, encrypted memory for LangChain, backed by Perseus Vault (formerly "Mimir"/"Mneme") — an open-source (MIT) memory engine with FTS5 + dense hybrid search and optional AES-256-GCM encryption, exposed over the Model Context Protocol (MCP) stdio transport.

It gives a LangChain agent durable memory that survives across runs and processes, stored in a single local SQLite file you control — no external service, no cloud.

What you get

This package wraps Perseus Vault using the modern langchain-core interfaces:

  • create_perseus_vault_tools(client) — a pair of StructuredTools (perseus_vault_remember / perseus_vault_recall) you give to an agent so it can manage its own long-term memory via tool calls. This is the current-recommended LangChain pattern (the legacy Memory / ConversationBufferMemory classes are deprecated).
  • PerseusVaultRetriever — a BaseRetriever returning Documents, for drop-in use in RAG chains and anywhere LangChain accepts a retriever (.invoke(query)).
  • PerseusVaultClient — the low-level MCP stdio client, if you want direct access.

Prerequisite: the perseus-vault binary

This package talks to a local perseus-vault executable via JSON-RPC over stdio. You must have it installed:

On Windows the binary may be named perseus-vault.exe; ensure its directory is on PATH, or pass the full path. (Some installs also ship a mimir compat symlink, but perseus-vault is the canonical name.)

Install

pip install langchain-perseus-vault

Usage

As agent tools

from langchain_perseus_vault import PerseusVaultClient, create_perseus_vault_tools

client = PerseusVaultClient(db_path="~/.langchain/mimir.db")
tools = create_perseus_vault_tools(client)  # [perseus_vault_remember, perseus_vault_recall]

# Bind to any tool-calling model / agent:
from langchain.chat_models import init_chat_model

llm = init_chat_model("anthropic:claude-sonnet-4-5")
llm_with_memory = llm.bind_tools(tools)

resp = llm_with_memory.invoke("Remember that my favorite language is Rust.")
# ... the model will call perseus_vault_remember; execute the tool call as usual.

As a retriever

from langchain_perseus_vault import PerseusVaultClient, PerseusVaultRetriever

client = PerseusVaultClient(db_path="~/.langchain/mimir.db")
client.remember("The capital of France is Paris.")

retriever = PerseusVaultRetriever(client=client, k=5)
docs = retriever.invoke("What is the capital of France?")
print(docs[0].page_content)  # -> "The capital of France is Paris."

Direct client

from langchain_perseus_vault import PerseusVaultClient

client = PerseusVaultClient(db_path="~/.langchain/mimir.db")
client.remember("Project deadline is July 15.", tags=["project", "deadline"])
items = client.recall("when is the deadline")
print(items[0]["text"])

How it works

PerseusVaultClient spawns perseus-vault --db <path> as a subprocess and speaks JSON-RPC 2.0 (MCP) over its stdin/stdout. A background reader thread and a lock make calls thread-safe and timeout-bounded. Memories are stored via perseus_vault_remember and retrieved via perseus_vault_recall.

License

MIT © 2026 Perseus Computing LLC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_perseus_vault-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_perseus_vault-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_perseus_vault-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_perseus_vault-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for langchain_perseus_vault-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a4fe5ab7a93fb3748bf587e19816b7bbfe8de45ee7977aad1c8a926ff587d3d
MD5 cb33df3d2ac60f7cf31db1af37ef8b52
BLAKE2b-256 f4b34a9319918e4104cadfabfc7dd6f5481f6adae8b6d158b89cc14efb9805c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_perseus_vault-0.1.0.tar.gz:

Publisher: publish.yml on Perseus-Computing-LLC/langchain-mimir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_perseus_vault-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_perseus_vault-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd30df218106e009f69be9a4fff63fbbb472db157388b991f6009c10cbe5d7d
MD5 69936b2f667d8d7fae9c7bd03226e284
BLAKE2b-256 f0f8d286237928d443ef895d37644c3de2720e4c87219bc398cd713351f740a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_perseus_vault-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Perseus-Computing-LLC/langchain-mimir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page