This guide gets you from zero to persistent AI memory in your MCP client (Cursor, Claude Desktop, or any MCP-compatible host) in under 5 minutes.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.
Prerequisites
- Node.js 18 or newer
- An MCP-compatible client (Cursor or Claude Desktop)
1. Initialize kontxt
~/.kontxt/vault.db(SQLite vault)~/.kontxt/config.json(settings; may include keys if you add them)- MCP host config entries for supported hosts
1.1 What init actually does
init is the core user flow. It prepares the local store and makes kontxt runnable as an MCP server.
It will:
- Create the
~/.kontxt/directory if it does not exist - Create
~/.kontxt/vault.dbif it does not exist - Create or update
~/.kontxt/config.json - Attempt to write MCP host config files for supported hosts when it can locate them
2. Verify your vault exists
vault.db.
2.1 Confirm kontxt can read and write
Store one memory and immediately search for it:3. (If needed) configure your MCP client manually
kontxt init can write MCP entries automatically. If your setup needs manual configuration, use these patterns.
- Cursor
- Claude Desktop (macOS)
Cursor MCP config typically lives at
~/.cursor/mcp.json:3.1 Validate the MCP server in a terminal
Before you restart your host, confirm the server starts:Ctrl+C and proceed.
4. Test it (CLI)
5. Use it in your AI client
Restart your MCP client. From now on, kontxt will automatically surface relevant memories from your vault into your AI sessions. Try asking your AI client something related to what you stored. It should already know.You now have persistent memory running locally. Every session builds on the last.
5.1 What “memory” looks like in practice
Ask your host something that should trigger retrieval:- Ask a question that depends on a stored preference, such as “What language should I use for this repo”.
- If kontxt is connected and you previously stored “I prefer TypeScript”, the host should respond consistently with that preference.
Optional: embeddings
For better semantic search, you can store an OpenAI key during init:Troubleshooting
init ran but ~/.kontxt/vault.db is missing
Run init again and then check the directory:
My host does not show kontxt tools
Most hosts load MCP servers at startup. Fully quit and reopen the host. If you configured the host manually, validate your JSON file is valid JSON and that it contains:npx -y @4stax/kontxt serve in a terminal to confirm it starts without errors.
Next steps
How memory works
Understand relevance ranking and memory types
MCP tools reference
Full reference for all exposed MCP tools
CLI reference
All CLI commands and flags
Self-hosting
Run kontxt on your own server

