CtxVault
Open-source Python 3.10+ MIT Licensed

Local memory infrastructure for AI agents

Store knowledge, skills and facts in typed vaults
you compose, control and query, entirely local.

pip install ctxvault
Get started →

The vault

The building block of CtxVault.

  • A directory on your machine
  • Semantic (knowledge), Skill (procedures) or Episodic (facts over time)
  • Public or restricted access
  • Attached to one or more agents
Configurable topology

Define any agent–vault architecture

Memory slots can be public or restricted, shared across agents or private to one. Attach agents to vaults, control who can read and write, and compose the topology that fits your use case, from a single vault to a multi-agent system with layered access boundaries.

CtxVault architecture: agents, vaults, access boundaries, CLI observability
Typed memory

Semantic, procedural and episodic vaults

Cognitive architectures such as ACT-R and CoALA separate long-term memory into declarative knowledge and procedural skills. CtxVault makes this distinction structural: semantic vaults store what the agent knows, skill vaults store how it should act, episodic vaults store what currently holds and what used to. All three participate in the same topology.

Semantic, procedural and episodic memory vaults

Core principles

Typed memory

Semantic vaults hold knowledge, what the agent knows. Skill vaults hold procedures, how the agent behaves. Episodic vaults hold statements with a validity window, what holds right now. The distinction is structural, not a metadata label.

Structural isolation

Every vault is an independent index. Restricted vaults are attached to specific agents. The boundary is part of the architecture, not a rule in a config file.

Persistent across sessions

Context written in one session is retrievable days later. "Financial constraints" matches "cut cloud costs by 15%" written three days prior. In an episodic vault a fact is superseded rather than overwritten, so the correction keeps both versions and the timeline stays readable.

Observable by default

Every vault is a plain directory on your machine. Read it, edit it, query it through the CLI. Contribute documents alongside what agents write.

Local-first

No cloud, no telemetry, no external services. Vaults live on disk. What you connect to that knowledge base is your choice.

Three interfaces, one vault layer

CLI

Human-facing

Monitor vaults, inspect agent-written content, add documents, query knowledge bases directly.

HTTP

Programmatic

Connect LangChain, LangGraph, or any pipeline via REST. Full CRUD, semantic search, agent write support.

MCP

Autonomous agents

Any MCP-compatible client gets direct vault access. The agent handles list, query, write and read_skill on its own, and records or corrects facts with write_episode and supersede_episode.

vs. alternatives

CtxVaultChromaDB + customLangChain MemoryMem0
Vault isolation✓you build it✗✗
Access control✓you build it✗✗
Typed memory✓✗✗✗
Bi-temporal memory✓you build it✗partial
Agent-written memory✓you build itpartialpartial
CLI observability✓✗✗✗
Local-first✓✓✓self-hosted
MCP server✓you build it✗hosted

Quickstart

# Initialize vaults
ctxvault init knowledge
ctxvault init skills --type skill

# Add documents, index, and query
ctxvault index knowledge
ctxvault query knowledge "what decisions were made last week?"

# Inspect skills
ctxvault skills skills
ctxvault skill skills "Weekly Engineering Update"

# Facts that change over time
ctxvault init memory --type episodic
ctxvault write-episode memory "Sarah is the main contact" -e Sarah
ctxvault episodes memory --entity Sarah

# See everything
ctxvault vaults

Examples