kontxt is a local process that stores and retrieves durable context through MCP.Documentation Index
Fetch the complete documentation index at: https://docs.4stax.com/llms.txt
Use this file to discover all available pages before exploring further.
Storage
kontxt stores memories in a local SQLite database:- Vault path:
~/.kontxt/vault.db - Entry style: short, typed memories rather than full transcripts
- Types:
fact,preference,project,decision,skill,episodic
npx -y @4stax/kontxt add, kontxt writes a new row into the vault. When your host calls store_memory, kontxt does the same thing, except the write is triggered by the host.
What a memory entry represents
A memory entry is meant to be independently useful later. It should make sense when retrieved in isolation. Good examples:- “Prefers TypeScript and concise answers”
- “This repo uses Next.js and Tailwind”
- “Decision: use JWT with 7 day expiry because we need stateless auth”
- “See above”
- “That bug from earlier”
- A raw log dump
Retrieval
When your host (Cursor, Claude Desktop, etc.) needs grounding, it calls kontxt MCP tools such asget_relevant_context and search_memories. kontxt ranks candidate memories and returns a compact set of the most relevant items.
Retrieval in detail
The host provides a query that represents the current task. kontxt:- Identifies candidate memories.
- Computes semantic similarity when embeddings are available.
- Applies additional signals such as recency and frequency.
- Returns the top results with ids and content.
Embeddings
kontxt can use multiple embedding backends. Each memory carries anembedding_tier, and kontxt avoids mixing tiers during similarity search to keep results stable when you change providers.
Why tiers matter
Embedding vectors from different providers are not comparable. Tiering allows kontxt to remain stable when you change backends. If you start offline using Transformers.js and later add an OpenAI key, you will have two tiers in the vault. kontxt will not compare across those tiers when scoring similarity.What to expect
- Local first: by default, nothing leaves your machine.
- Selective injection: only a small, relevant bundle is returned, not your whole vault.
- Composable: the same local vault can back multiple MCP hosts.

