How to Add Memory to Kilo Code
Kilo Code is an emerging and powerful alternative to Cline for VS Code. Like all AI assistants, it needs a way to remember your project context across sessions. This guide shows you how to give Kilo persistent, structured memory using Memstate MCP.
What You Need
- VS Code with the Kilo Code extension installed
- Node.js 18+ installed on your machine
- A free Memstate AI account (no credit card required)
Step-by-Step Setup
1Get your Memstate API Key
Sign up at memstate.ai for free. Go to Dashboard → API Keys and create a new key. Copy it to your clipboard.
2Open Kilo MCP Settings
In VS Code, open the Kilo sidebar. Click the MCP Servers icon (it looks like a little plug) at the top, then click Edit MCP Settings. This will open your kilo_mcp_settings.json file.
3Add the Memstate Server
Add the Memstate server configuration to the JSON file, pasting your API key where indicated:
{
"mcpServers": {
"memstate": {
"command": "npx",
"args": ["-y", "@memstate/mcp"],
"env": {
"MEMSTATE_API_KEY": "your-api-key-here"
}
}
}
}4Verify the Connection
Save the file. In the Kilo sidebar, you should now see a green dot next to the Memstate server indicating it is connected. You can test it by asking Kilo:
Please search my memory for the current database engine.
Crucial: Tell Kilo When to Use Memory
Just giving Kilo the MCP tools is not enough; you need to tell it when to use them. The best way to do this is by creating a .kilorules file in your project root, or running our init command to generate it for you:
npx @memstate/mcp init
This ensures Kilo automatically checks memory before starting a task, and saves a summary after completing one.
Related Guides
Stop repeating yourself to Kilo
Get structured, versioned memory that never gets confused.