Persistent Memory for
Kilo Code via MCP
Kilo Code is an open-source VS Code AI extension that gives you a fully autonomous coding agent inside your editor. Like all AI coding tools, it has no memory between sessions. This guide shows you how to connect the Kronvex MCP server to Kilo Code — so your agent remembers architectural decisions, coding patterns, and debugging history across every workspace.
What is Kilo Code?
Kilo Code (available on the VS Code Marketplace) is an open-source alternative to Cline and GitHub Copilot Chat. It provides a fully autonomous coding agent that can read files, edit code, run terminal commands, and browse documentation — all from within VS Code. It supports multiple AI backends (OpenAI, Anthropic Claude, Gemini, local Ollama models) and has native support for the Model Context Protocol (MCP).
MCP is an open standard developed by Anthropic that allows AI tools to connect to external servers providing tools, resources, and prompts. When you configure an MCP server in Kilo Code, its tools become available to the AI agent as native capabilities — the agent can call them just like it calls built-in VS Code functions.
Why session memory matters for AI coding agents
AI coding agents are most powerful when they have context about the project they're working on. But every Kilo Code session starts from scratch. The agent has to re-learn from the codebase on every task: what patterns are used, what's been tried before, what architectural decisions have been made.
Common symptoms of missing memory:
- The agent suggests an approach you already tried and rejected last week
- You spend the first 5 minutes of every session pasting context into the chat
- The agent doesn't know about a recent refactor and writes code against the old API
- Debugging sessions lose all their context when VS Code is restarted
- New team members using Kilo Code can't benefit from decisions made before their time
With Kronvex connected via MCP, Kilo Code can call remember, recall, and inject_context tools natively. The agent decides when to save and retrieve memories — just like a senior developer keeps mental notes of past decisions.
Prerequisites
- Kilo Code extension installed in VS Code (search "Kilo Code" in the Extensions marketplace)
- A Kronvex account — sign up free at kronvex.io/dashboard, no credit card required
- A Kronvex API key (starts with
kv-) and an Agent ID (a UUID from the dashboard) - Node.js 18+ installed (required to run the Kronvex MCP server)
Configure the Kronvex MCP server in Kilo Code
Kilo Code stores MCP server configuration in its VS Code settings. Open your settings with Cmd/Ctrl + Shift + P → Preferences: Open User Settings (JSON) and add the Kronvex MCP server:
{ "kilocode.mcpServers": { "kronvex": { "command": "npx", "args": ["-y", "@kronvex/mcp-server"], "env": { "KRONVEX_API_KEY": "kv-your-api-key-here", "KRONVEX_AGENT_ID": "your-agent-uuid-here" } } } }
Alternatively, you can configure MCP servers directly from the Kilo Code panel in VS Code. Click the MCP Servers tab in the Kilo Code sidebar, then click Add MCP Server and paste the following JSON:
{ "command": "npx", "args": ["-y", "@kronvex/mcp-server"], "env": { "KRONVEX_API_KEY": "kv-your-api-key-here", "KRONVEX_AGENT_ID": "your-agent-uuid-here" } }
KRONVEX_API_KEY and KRONVEX_AGENT_ID set, then use "${env:KRONVEX_API_KEY}" syntax in the JSON.
Verify the connection
After saving the configuration, reload the Kilo Code MCP servers (click the refresh icon in the MCP Servers panel, or restart VS Code). You should see kronvex listed as a connected server with a green indicator and the following tools available:
kronvex_remember— store a new memory with content, type, and optional session IDkronvex_recall— semantic search across memories, returns array with scoreskronvex_inject_context— returns a pre-formatted context string for injection into promptskronvex_list_memories— list all memories for the agent with optional filterskronvex_delete_memory— delete a specific memory by ID
To confirm, type in the Kilo Code chat: "Use Kronvex to recall anything you know about this project." The agent will call kronvex_recall with a broad query and return any existing memories. On a fresh setup, the response will be empty — that's expected.
Using memory in your coding sessions
Letting the agent manage memory automatically
The simplest approach is to include a memory instruction in your Kilo Code system prompt (Settings → Custom Instructions). This tells the agent to use Kronvex proactively:
You have access to persistent memory via the Kronvex MCP tools. At the start of each task: - Call kronvex_inject_context with the task description to retrieve relevant past context - Reference this context when making decisions During and after tasks: - Call kronvex_remember to store significant decisions, discoveries, or patterns - Use memory_type="semantic" for facts and decisions - Use memory_type="procedural" for coding patterns and best practices - Use memory_type="episodic" for things that happened (bugs found, PRs merged, etc.) - Always include session_id="{{ workspace_name }}" to scope memories to this project Never store sensitive data (tokens, passwords, personal information) in memory.
Manually triggering memory operations
You can also trigger memory operations directly in the chat:
- "Remember that we switched from REST to GraphQL for the dashboard API because of the N+1 query problem."
- "What do you know about our authentication flow?"
- "Recall any past issues we've had with the payment integration."
- "Store the fact that all database migrations must be backward-compatible."
The agent will translate these natural language requests into the appropriate MCP tool calls automatically.
Per-workspace memory configuration
For teams with multiple projects, it's important to scope memories correctly. The cleanest pattern is one Kronvex agent per project, configured at the workspace level in VS Code's .vscode/settings.json:
{ "kilocode.mcpServers": { "kronvex": { "command": "npx", "args": ["-y", "@kronvex/mcp-server"], "env": { "KRONVEX_API_KEY": "kv-your-api-key-here", "KRONVEX_AGENT_ID": "project-specific-agent-uuid", "KRONVEX_DEFAULT_SESSION": "myapp-frontend" } } } }
The KRONVEX_DEFAULT_SESSION environment variable pre-fills the session_id parameter in all memory calls, so memories are automatically scoped to the current project without needing to specify it manually.
Use cases for persistent project memory
Onboarding new developers
When a new developer joins the team and opens the project in VS Code with Kilo Code, they immediately have access to months of engineering decisions. Instead of reading through 200 PRs and Confluence pages, they can ask Kilo Code natural language questions and get answers grounded in the project's actual history.
Long-running feature development
When you're building a complex feature over several weeks, Kilo Code can maintain a memory of the sub-decisions made along the way. "We used optimistic updates here because the API latency was 400ms on 3G" — that's the kind of context that's easy to forget and expensive to rediscover when reviewing code six months later.
Recurring bug patterns
Store root causes of bugs as procedural memories. When a similar symptom appears, Kilo Code can recall the previous root cause and suggest starting the investigation there. Pattern: "Race condition in the useEffect cleanup — always check if the component is still mounted before setting state."
Code review context
Before a code review session, ask Kilo Code to recall what the PR is supposed to accomplish and any related past decisions. The agent can surface relevant context ("we decided against this approach in March because of X") that makes code review more informed.
Tips and best practices
Write memories like documentation
A good memory is specific, self-contained, and includes the why. "Changed API base URL to api.v2.myapp.com — old endpoint deprecated 2026-04-01, see migration guide in /docs/api-migration.md" is far more useful than "updated API URL." The Kronvex semantic search will surface it even if future queries use different words like "endpoint change" or "base URL update."
Use TTL for temporary context
Add ttl_days to memories that are only relevant for a limited time — sprint-specific decisions, temporary workarounds, debugging notes. A memory about "disabling email sending in dev until 2026-05-15" should expire automatically, not clutter your memory store permanently.
- One agent per repo: avoid mixing frontend and backend memories in the same agent — retrieval quality degrades when signal-to-noise ratio drops
- Semantic memory types:
semanticfor facts,episodicfor events,proceduralfor patterns — filtering by type at recall time sharpens results - EU hosted: all Kronvex memory is stored in Frankfurt — no data crosses outside the EU, suitable for GDPR-sensitive codebases
- Confidence scoring: Kronvex scores recall results by similarity, recency, and access frequency — recently used memories rank higher, naturally surfacing what's most relevant to active work
Give Kilo Code the memory it deserves
Free plan — 500 memories, 3 agents. No credit card. Connect in under 3 minutes.
Get your free API key →