Skip to main content
Nowledge MemNowledge Mem

Kimi Code × Nowledge Mem

Connect Kimi Code to your cross-tool memory with a Kimi-native package, MCP, and automatic local thread sync.

For your agent

Paste this into Kimi Code:

Read https://mem.nowledge.co/SKILL.md and follow the instructions to install or update Nowledge Mem for Kimi Code. Verify with nmem status and the Context Bundle or Working Memory check, then summarize what changed.

Kimi Code can use Nowledge Mem through a Kimi-native package. It loads Mem guidance at session start, connects to Mem through MCP, and can sync Kimi Code conversations into Mem Threads with a local lifecycle hook.

Recent Kimi Code builds load those hooks directly from kimi.plugin.json, so the connector now feels native: install the package, enable it, reload, and Kimi Code can start reading memory and saving sessions. Older Kimi Code sessions still use the same safe backfill command: preview first, then import with nmem t sync --from kimi-code --apply.

This guide is for Kimi Code, the terminal and IDE coding agent. Kimi web chat is covered by the Browser Extension. Kimi Work is a separate desktop product with its own embedded runtime; use the Kimi Work guide for that setup.

Before You Start

  • Nowledge Mem is running locally, or you have a reachable remote Mem server
  • Kimi Code is installed
  • nmem 0.9.19 or newer works on the same machine as Kimi Code. Kimi Code thread sync depends on the CLI support for --from kimi-code.
nmem status
nmem --version

If nmem exists but rejects t sync --from kimi-code, config mcp show --host kimi-code, or another Kimi-specific command, update the CLI before debugging MCP or session sync:

  • Desktop-bundled CLI: open Mem and run Settings → Preferences → Developer Tools → Install CLI again.
  • PyPI CLI: python3 -m pip install --user --upgrade nmem-cli
  • pipx CLI: pipx upgrade nmem-cli

If Kimi Code runs on a different machine from the desktop app, install the standalone CLI there first:

python3 -m pip install --user nmem-cli
nmem --version
nmem config client set url https://your-server
nmem config client set api-key your-key

Install The Package

Install the package in Kimi Code:

/plugins install https://github.com/nowledge-co/community/tree/main
/reload

Use the explicit /tree/main ref. With a bare repository URL, Kimi prefers the latest GitHub Release; a published release can predate the Kimi manifest and return No manifest. The main branch has a root kimi.plugin.json shim, so this path loads the Kimi package directly. Kimi downloads the repository zip for this install; it does not clone submodules. The package includes a session-start skill and a local MCP server for the desktop app at http://127.0.0.1:14242/mcp/.

It also includes native plugin hooks for Stop, SessionEnd, PreCompact, SubagentStop, and Interrupt, plus quick commands:

/nowledge-mem:status
/nowledge-mem:sync-now
/nowledge-mem:import-history

For remote Mem or authenticated localhost, generate a user-level Kimi MCP block:

nmem config mcp show --host kimi-code

Paste the generated nowledge-mem server into $KIMI_CODE_HOME/mcp.json or ~/.kimi-code/mcp.json.

If your installed nmem does not recognize --host kimi-code yet, update the same CLI source first. Until then, use the generic streamable HTTP MCP block from the Connectors overview and set the URL/API key for your Mem server manually.

Thread Sync

Modern Kimi Code reads the Nowledge Mem hook declarations from the plugin manifest. After /reload, the connector syncs sessions automatically when a turn stops, a session exits, context is compacted, a subagent finishes, or a turn is interrupted.

If you are on an older Kimi Code build that does not load plugin manifest hooks, run the fallback installer once. It writes the same hook rules into your Kimi Code config and leaves the rest of the file untouched:

python3 ~/.cache/nowledge-community/nowledge-mem-kimi-code-plugin/scripts/install_hooks.py

Verify

Restart Kimi Code and ask:

Is Nowledge Mem connected? Read my current context.

Success means Kimi Code can call the Nowledge Mem MCP tools and return Context Bundle, Working Memory, or an empty-but-successful memory result.

Then finish a short Kimi Code exchange and check:

nmem t list --source kimi-code -n 5

You should see the recent Kimi Code thread after the hook has run. If you delegated work to a Kimi subagent, that subagent's wire log is imported into the same thread with subagent provenance metadata.

Import Older Sessions

Kimi Code stores local sessions under ~/.kimi-code/sessions. Import them with:

nmem t sync --from kimi-code --limit 20
nmem t sync --from kimi-code --apply

This works for local Mem and remote Mem because the nmem CLI reads the local Kimi Code transcript files and uploads normalized thread messages to your configured Mem server. It is safe to rerun; Mem uses stable thread and message IDs to deduplicate repeated imports.

On this page