CtxVault

CtxVault

ctxvault•byfilippo-venturini

Local memory infrastructure with an MCP server that lets AI agents query and update knowledge, skills and episodic records in isolated vaults.

License: MIT•Runtime: Awaiting documentation review•Category: ai agents-models

WHAT IT DOES

  • •Provides local memory infrastructure for AI agents using isolated, directory-backed vaults.
  • •Supports typed memory: semantic documents, skill/procedural markdown, and episodic statements with validity and transaction timelines.
  • •Lets agents query and update knowledge, skills, and episodic records through an MCP server.
  • •Offers additional integration surfaces described as a Python client, CLI, and HTTP API.
  • •Stores vaults as local directories and includes a read-only local memory viewer UI.
  • •Supports public or restricted vaults with access granted to specific agents.

BEST FOR

  • •AI agents that need persistent, queryable memory across sessions.
  • •Multi-agent setups requiring structural isolation and per-agent vault access.
  • •Local-first deployments where memory should remain on disk without cloud services.
  • •Projects that need distinct semantic, procedural, and episodic memory types.
  • •Human inspection and control of agent-written memory through CLI and UI.

ABOUT CTXVAULT

CtxVault is cataloged as an MCP server attributed to filippo-venturini. Local memory infrastructure with an MCP server that lets AI agents query and update knowledge, skills and episodic records in isolated vaults. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for CtxVault are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What is CtxVault?

CtxVault is described as local memory infrastructure for AI agents, organized around isolated vaults with typed memory.

What memory types does it support?

The source lists semantic memory for documents, skill/procedural memory for markdown procedures, and episodic memory for statements with validity and transaction timelines.

How can it be integrated?

The source describes four interfaces: a Python client, CLI, HTTP API, and MCP server.

Is it local or cloud-based?

It is described as local-first, with no cloud, telemetry, or external services; vaults are plain directories on the machine.

Does it provide access control?

Yes. Vaults can be public or restricted, with access granted to specific agents.

Does it include a UI?

Yes. The source describes a read-only local memory viewer with an export option.

Does it automatically extract facts from conversations?

No. The source states that the agent decides what to write and that automatic fact extraction is not included.

Upstream README

View this exact version on GitHub

README.md · d612d6e61b17 · Fetched 2026-11-13 02:31:35 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Logo

Local memory infrastructure for AI agents

Isolated vaults. Typed memory. Agent-autonomous. Human-observable.

License: MIT PyPI version Python PyPI - Downloads

Live demo • Docs • Quick Start • Examples • Roadmap • Contributing


What is CtxVault?

Most agent frameworks treat memory as an afterthought: a shared vector store where isolation depends on configuration staying correct and everything, facts and procedures alike, gets embedded into the same undifferentiated index. The agent cannot tell what it knows from how it should act.

CtxVault is built around a different primitive. Memory is organized into vaults: self-contained, directory-backed units with explicit types, one for each kind of memory an agent has. Isolation is structural, the topology is defined explicitly (one vault per agent, a shared knowledge base, private skills for a specific role, or any combination), with access control that determines exactly which agents can reach which vault.

The result is a memory layer that behaves like real infrastructure: typed, composable, observable, persistent and entirely local.

CtxVault architecture schema

Core Principles

Typed memory: semantic, procedural and episodic

Classical cognitive architectures, from ACT-R (Anderson et al., 2004) to CoALA (Sumers et al., 2024), separate an agent's long-term memory into distinct modules: what it knows, how it acts, and what happened. Most agent frameworks ignore the distinction and store everything in a single vector index. In CtxVault each kind of memory is a vault type:

VaultMemoryWhat it holdsHow the agent reads it
SemanticSemantic: what the agent knowsDocuments (PDF, DOCX, MD, TXT), chunked and embedded into a local vector indexBy meaning: a query returns the closest chunks, with their source
SkillProcedural: how the agent actsProcedures in markdown, each with a name and a descriptionBy name: the agent lists the skills and reads the one it needs
EpisodicEpisodic: when something was trueStatements with two timelines: when they hold in the world, and when the vault learned itBy entity, validity and source, as of today or any past instant

All three types share the same primitives: public or restricted, local or global, composable in any topology. How each type works →

Typed memory: an agent queries a semantic vault for knowledge, reads a skill vault for behavioral instructions, and consults an episodic vault for what currently holds

Structural isolation and access control

Isolation enforced through prompt logic or metadata schemas is fragile: it grows harder to reason about as systems scale, and fails silently when it breaks.

In CtxVault, each vault is an independent index. Agents have no shared retrieval path unless one is explicitly defined. Vaults can be declared restricted, with access granted to specific agents directly through the CLI. The boundary is part of the architecture, not a rule written in a config file that someone might later get wrong.

Found 3 vaults

> agent-a-vault [RESTRICTED]
  path:    ~/.ctxvault/vaults/agent-a-vault
  agents:  agent-a

> shared-vault [PUBLIC]
  path:    ~/.ctxvault/vaults/shared-vault

> agent-c-vault [RESTRICTED]
  path:    ~/.ctxvault/vaults/agent-c-vault
  agents:  agent-c

Persistent memory across sessions

Agents lose all context when a session ends. CtxVault gives them a knowledge base that persists across conversations, queryable by meaning rather than exact match. Context written in one session is retrievable days later using semantically related language.

Agent saves context in session one, new chat, new session, memory intact

Persistent memory across sessions, shown with Claude Desktop, works with any MCP-compatible client.

Observable and human-controllable

When agents write to memory autonomously, visibility into what they write is not a debugging feature: it is the foundation of a trustworthy system. Whatever an agent wrote, through any interface, you can look at it three ways, and add to it yourself.

On disk. Every vault is a plain directory on your machine, readable and editable with any tool. Drop a document into a semantic vault or a skill into a skill vault, index it, and the agent sees it next to what it wrote on its own.

.ctxvault/
├── config.json              # the registry: every vault, its type, who can reach it
└── vaults/
    ├── product-sheets/      # semantic: your documents, and the chroma/ index
    ├── counter-procedures/  # skill: one markdown file per skill
    └── store-facts/         # episodic: episodes.db, a SQLite file

From the CLI. The same vaults, queried directly, independent of what any agent is doing.

ctxvault docs my-vault                                   # what the agent has written
ctxvault query my-vault "what decisions were made last week?"
ctxvault index my-vault                                  # add your own documents
ctxvault episodes my-vault --all                         # an episodic vault's statements

In the browser. ctxvault ui opens the memory viewer: a map of every vault, its type and the agents that can reach it, and a page per vault. Semantic documents show their chunks as the agent receives them, skills are rendered from their markdown, and an episodic vault has a time cursor that rewinds it to any past day. It is read-only and entirely local, and --export writes it to one self-contained HTML file. Try the live demo, no install needed: the bakery of example 07, three agents, six vaults, a year of facts.

The ctxvault ui map: hovering a semantic, a skill and an episodic vault, then an agent and the vaults it can reach

The map of the live demo: three memory types, three agents, and what each agent can reach.

Local-first

No cloud, no telemetry, no external services. Vaults are plain directories on your machine, the storage layer is entirely local. What you connect to that knowledge base is your choice.


Integration Modes

CtxVault exposes the same vault layer through four interfaces. Use whichever fits your context, or combine them freely.

Python client: In-process. Import Client, open a vault by name and call it directly, with no server to start: for scripts, tests, pipelines and agents that own their memory.

CLI: Human-facing. Monitor vaults, inspect agent-written content, add your own documents, query knowledge bases directly.

HTTP API: Programmatic integration. Connect LangChain, LangGraph, or any custom pipeline to vaults via REST. Full CRUD, semantic search, and agent write support.

MCP server: For autonomous agents. Give any MCP-compatible client direct vault access with no integration code required. The agent handles list_vaults, query, write_doc, and list_docs on its own, and on an episodic vault it records and corrects facts with write_episode, query_episodes, supersede_episode and invalidate_episode, counts repetitions with confirm_episode, holds contradictions open with dispute_episodes, and discovers what the vault is about with list_entities.

Whichever door wrote it, ctxvault ui shows it: the viewer reads the same vaults, so what an agent recorded over MCP is on the page next to what you indexed from the CLI.


CtxVault vs Alternatives

CtxVaultChroma + your codeLangChain MemoryMem0Graphiti (Zep)
Runs without cloud services✓✓✓self-hostedself-hosted, plus a graph database
MCP server✓you build it✗✓✓
Automatic fact extraction from conversations✗ (the agent decides what to write)you build it✗✓✓
Distinct memory types (semantic, procedural, episodic)✓you build it✗✗✗
Bi-temporal facts (valid time and transaction time)✓you build it✗partial✓
Graph-structured memory (entities and relations)✗ (planned)you build it✗✓✓
Per-agent access control✓you build it✗✗✗
Storage as plain files on disk✓✓✗✗✗ (graph database)
Inspection UIlocal✗✗hosted✗

The ✗ in the CtxVault column are real: there is no graph layer and it does not extract facts for you. The ✓ are what it was built for: memory types, time, access control, and storage you can open as a folder.


Examples

Seven scenarios, each with full code and setup instructions.

#ExampleWhat it shows
01Single-Vault RAGSingle vault, single agent. Semantic RAG over PDF, MD, TXT, DOCX with source attribution. ~100 lines.
02Multi-Agent IsolationTwo agents, two vaults. Each agent has no retrieval path to the other's vault: isolation enforced at the infrastructure layer, not through metadata filtering. ~200 lines.
03Persistent MemoryAn agent that recalls context across sessions using semantic queries. "financial constraints" retrieves "cut cloud costs by 15%" written three days prior.
04Access ControlThree agents, five vaults: private, shared between a subset, and public. A tiered support system where access boundaries reflect organizational boundaries.
05Procedural MemoryOne agent, two vault types, semantic and skill, integrated via MCP. Retrieves knowledge for what to say and skills for how to say it.
06Episodic MemoryOne account followed across six months. Facts are superseded instead of overwritten, so the briefing uses only what holds today while April is still reconstructable.
07Full Memory TopologyEverything in one place: three agents, six vaults, all three memory types, access rules, a year of facts replayed with their dates. The capstone example, a small bakery, and the dataset behind the live demo.

Installation

Requirements: Python 3.10+

pip install ctxvault

From source, with uv:

git clone https://github.com/Filippo-Venturini/ctxvault
cd ctxvault
uv sync            # creates .venv and installs all dependencies
uv run ctxvault    # run the CLI

Quick Start

Five minutes from nothing to an agent that remembers. Run these from your project's root.

1. Create a vault. It is a folder, registered in .ctxvault/config.json next to you, like git init.

ctxvault init notes

2. Give it something to know. Drop .md, .txt, .pdf or .docx files into .ctxvault/vaults/notes/ and index them.

ctxvault index notes

3. Ask it. Retrieval is by meaning, so the words do not have to match.

ctxvault query notes "what did we decide about pricing?"

4. Give it to your agent. The quickest way is MCP: add the server to your client's config (Claude Desktop, Cursor, any MCP client) and restart it. With uv installed nothing else is needed:

{
  "mcpServers": {
    "ctxvault": { "command": "uvx", "args": ["ctxvault", "mcp"] }
  }
}

Or uv tool install ctxvault once, and use { "command": "ctxvault-mcp" } instead.

The agent can now list your vaults, query them, and write what it learns back. From your own code instead, use the Python client in-process or the HTTP server.

5. See what it holds.

ctxvault ui

Next: a skill vault for procedures (ctxvault init procedures --type skill), an episodic vault for facts that change (ctxvault init facts --type episodic), and restricted vaults so each agent reaches only its own.


Documentation

The full reference lives on the documentation site:


Roadmap

  • CLI MVP
  • FastAPI server
  • Multi-vault support
  • Agent write API
  • MCP server support
  • Access control
  • Typed memory (semantic + procedural vaults)
  • Episodic memory (bi-temporal statements, supersession, time travel)
  • Graph-backed semantic memory
  • File watcher / auto-sync
  • Context pruning

Contributing

Contributions welcome! Please check the issues for open tasks.

Development setup:

git clone https://github.com/Filippo-Venturini/ctxvault
cd ctxvault

# With uv (recommended)
uv sync --extra dev
uv run pytest

# With pip
python -m venv .venv && source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest

Citation

If you use CtxVault in your research or project, please cite:

@software{ctxvault2026,
  author = {Filippo Venturini},
  title = {CtxVault: Local Semantic Knowledge Vault for AI Agents},
  year = {2026},
  url = {https://github.com/Filippo-Venturini/ctxvault}
}

License

MIT License - see LICENSE for details.


Security

MseeP.ai Security Assessment


Acknowledgments

Built on Chroma for vector storage, Sentence Transformers for embeddings, FastAPI for the HTTP API, the MCP Python SDK for the MCP server and Typer for the CLI. The memory viewer is built with Preact and htm, and the documentation with Material for MkDocs. The examples use LangChain.


Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for CtxVault from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/ctxvault)

REPOSITORY STATS

GitHub Stars63
Forks11

GitHub API evidence checked 2026-11-13 04:11:25.999Z (UTC). Repository-level counts are shared by all components, not individual server installs. Open issues including pull requests: 3.

Last repository push (UTC):2026-11-10

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related ai agents-models MCP Servers

Alternative and complementary servers in the same category

View all in ai agents-models →
Knowledge Graph Memory
@modelcontextprotocol/server-memory•Model Context Protocol

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

create_entitiescreate_relationsadd_observations+6 more
92K
AI & Multi-Agent
Sequential Thinking
@modelcontextprotocol/server-sequential-thinking•Model Context Protocol

Organize problem solving into revisable, branching thought steps through an MCP tool.

sequential_thinking
92K
AI & Multi-Agent

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.

146
AI & Multi-Agent