Skip to main content

Kimi Code + Memanto Integration

kimicode-memanto installs Memanto in Kimi Code. It is a convenience wrapper around the same connection engine used by memanto connect kimi-code, so both commands create and remove the exact same integration.

The integration combines managed AGENTS.md instructions, the memanto-memory CLI skill (or optional Model Context Protocol (memanto-mcp) server registration when memanto-mcp is installed), and lifecycle hooks for session synchronization and readable tool summaries.

Requirements

  • Python 3.10 or later.
  • Kimi Code.
  • A configured Memanto installation with an active agent (create and activate one with memanto agent create <name> or memanto agent activate <name>; --agent-id <name> can optionally override the agent used by MCP). Installing this package automatically installs memanto>=0.2.30 (install memanto-mcp as well if you want native MCP tools instead of the CLI skill).
  • MOORCHEH_API_KEY configured in ~/.memanto/.env (via memanto setup) or available in the environment.

Install the package:

pip install kimicode-memanto

Create or activate a Memanto agent and verify your configuration before starting Kimi Code:

memanto agent create my-project-assistant
memanto status

Install

Install into the current project:

kimicode-memanto install

Or specify a project directory and/or default Memanto agent ID for the MCP server:

kimicode-memanto install --project-dir ./my-project --agent-id my-project-assistant

This manages the following paths:

Path Purpose
AGENTS.md Adds or updates the Memanto-managed instruction block.
.kimi-code/skills/memanto/SKILL.md Deploys the memanto-memory command and metadata reference skill (when memanto-mcp is not used).
.kimi-code/mcp.json Optional: when memanto-mcp is installed and an active agent is set, registers the memanto MCP server instead of the CLI skill.
~/.kimi-code/config.toml Adds the Memanto lifecycle hooks and the mcp__memanto__* permission allow-rule inside a clearly marked managed section.

Note on API keys: MOORCHEH_API_KEY is never written into .kimi-code/mcp.json, ~/.kimi-code/mcp.json, or config.toml. memanto-mcp reads your key directly from ~/.memanto/.env (or the process environment).

Hooks are always user-level in Kimi Code. Kimi Code only supports hooks in the user-level ~/.kimi-code/config.toml (or $KIMI_CODE_HOME/config.toml), so even a project-local install writes the hook and permission rules there — inside a # >>> MEMANTO-MANAGED-SECTION >>> / # <<< MEMANTO-MANAGED-SECTION <<< block. The rest of your config.toml is never touched.

General Rule of Safety: The integration is strictly non-destructive. Anything you do with this CLI will completely preserve whatever you already have configured in your project. It will never overwrite, delete, or modify your existing custom Kimi Code configurations or user-managed MCP servers.

Global Install

Use --global (-g) to install for every Kimi Code project run by the current user:

kimicode-memanto install --global

Global installation writes to ~/.kimi-code/AGENTS.md and ~/.kimi-code/mcp.json (or under $KIMI_CODE_HOME when set). The hooks and permission rules go to the same user-level ~/.kimi-code/config.toml as a project install.

Project and global installations are independent, so they can be used together when needed.

What Kimi Code Receives

memanto-memory Skill & Optional MCP Server (memanto-mcp)

By default, the installer deploys the memanto-memory skill to .kimi-code/skills/memanto/SKILL.md (or ~/.kimi-code/skills/memanto/SKILL.md with --global), giving Kimi Code full reference guidelines for memanto remember, memanto recall, memanto answer, memanto edit, memanto forget, and memanto memory sync.

If memanto-mcp is installed (pip install memanto-mcp or pip install "kimicode-memanto[mcp]"), the installer registers the memanto MCP server in .kimi-code/mcp.json (or ~/.kimi-code/mcp.json), providing native MCP tools for reading and writing persistent memory:

Tool Purpose
remember Store a durable memory with required type, confidence, and provenance metadata.
batch_remember Store up to 100 structured memories in a single call.
recall Semantic search across stored memories before starting work or answering questions.
recall_recent Fetch the newest memories first without a search query.
recall_as_of Point-in-time memory snapshot (as_of timestamp).
recall_changed_since Differential recall for memories created or updated since a given window.
answer Synthesize a grounded RAG answer directly from agent memories.

The MCP entry sets MEMANTO_DEFAULT_AGENT_ID (from --agent-id or your currently active Memanto agent) and MEMANTO_DEFAULT_SOURCE="kimi-code", so every stored memory is automatically attributed to Kimi Code.

Managed AGENTS.md Instructions

The installer adds a versioned MEMANTO-MANAGED-SECTION (v1.1.0) to AGENTS.md. It directs Kimi Code to actively evaluate using the memanto MCP tools (recall, remember) or CLI commands at every step:

  1. When to Recall: On task initiation, ambiguous build/test failures, unstated user preferences, or explicit questions about prior decisions.
  2. When to Remember: When preferences/instructions, goals/commitments, bug-fix learnings/errors, architectural decisions/observations, or verified environment facts are established.
  3. The Abstraction Rule: Elevate stored memories to clean, declarative principles rather than chat logs.
  4. The Durability Test: Only store principles that will still matter in future sessions months from now.

The dynamic-memory portion of the managed block (MEMANTO-DYNAMIC-MEMORIES) is reserved for memanto memory sync. Re-running install safely updates the managed block in place while preserving the rest of AGENTS.md.

Lifecycle Hooks

The installer appends these hooks to the managed section of the user-level ~/.kimi-code/config.toml:

Hook When it runs Behavior
SessionStart (matcher startup|resume) On Kimi Code startup and resume Runs memanto memory sync so standing dynamic memories are refreshed before work begins.
PreCompact Before Kimi Code compacts the conversation Runs memanto memory sync --project-dir . to re-sync dynamic context before earlier messages are summarized away.
PostToolUse (matchers Bash and mcp__memanto__.*) After Memanto CLI or MCP tool calls Converts recognized Memanto operations into a short summary (e.g., 👾 Memanto · stored a decision, 👾 Memanto · recalled 3 memories).

The managed section also adds an mcp__memanto__* permission allow-rule so Memanto MCP tool operations run seamlessly without permission prompts.

Hook commands use the resolved Python interpreter that installed Memanto and absolute paths to Memanto's bundled hook scripts. This avoids failures caused by a project's active virtual environment or by python and python3 resolving differently on different machines.

Reinstall and Removal

Re-running installation is safe and idempotent:

kimicode-memanto install

It replaces only the Memanto-managed sections, retains everything else in config.toml byte-for-byte (including your own hooks, permission rules, and comments), updates the managed MCP entry (or skill fallback), and refreshes the managed AGENTS.md section.

Remove the project-local integration:

kimicode-memanto uninstall

Remove the global integration:

kimicode-memanto uninstall --global

Uninstall removes the Memanto instruction blocks, managed MCP server entry (or skill), and the managed section of config.toml when no other Kimi Code project or global installation remains active. It preserves other Kimi Code instructions, custom hooks, user-defined MCP servers, permissions, and settings, and it never deletes config.toml itself.

Equivalent Core Commands

These commands are equivalent:

kimicode-memanto install [--project-dir PATH] [--global] [--agent-id AGENT_ID]
memanto connect kimi-code [--project-dir PATH] [--global] [--agent-id AGENT_ID]
kimicode-memanto uninstall [--project-dir PATH] [--global]
memanto connect remove kimi-code [--project-dir PATH] [--global]

Use kimicode-memanto when you want a Kimi Code-specific entry point, or use memanto connect kimi-code when managing integrations through the core CLI.

Metadata

Release files for kimicode-memanto 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kimicode-memanto 0.1.0
File Size Uploaded Provenance Actions
kimicode_memanto-0.1.0.tar.gz 7.7 kB Without provenance Details for kimicode_memanto-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kimicode-memanto 0.1.0
File Interpreter ABI Platform Actions
kimicode_memanto-0.1.0-py3-none-any.whl Python 3 none any Details for kimicode_memanto-0.1.0-py3-none-any.whl

Total release size: 14.3 kB

Release files / kimicode_memanto-0.1.0.tar.gz

Download URL kimicode_memanto-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
982e391faa0746031687dfcc0dfdb7cec021ae724260d90aa68c92f1077e7095
BLAKE2b-256 checksum
How to use checksums
8b72cccfc21abb32fabbc5f04638184155e6c80894d9a908bcaa611783a5c020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / kimicode_memanto-0.1.0-py3-none-any.whl

Download URL kimicode_memanto-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
274aa019725be21721a1d4b327f9c6d1c4f677b6da79a9c1dc26a702e3632eaf
BLAKE2b-256 checksum
How to use checksums
f54df21e2adae0545771bb0d897bdc4bdc36936b4ceb0a29f464bf49de669e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for kimicode-memanto 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page