# Kirok Memory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/TadFuji/kirok-mcp  
**GitHub Stars:** 1  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/kirok-memory

## Description
Persistent memory for AI agents - hybrid semantic + keyword recall with autonomous consolidation

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "kirok-memory": {
    "command": "uvx",
    "args": ["--from","kirok-mcp","kirok-doctor"],
    "env": {
      "GEMINI_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `GEMINI_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the Kirok Memory MCP server does

The Kirok Memory MCP server provides persistent, searchable memory for MCP-compatible agents. It separates storage into banks and supports both raw memories and derived observations. Agents can save information, retrieve relevant items, build mental models, and manage stored data through MCP tools.

The main workflow is to retain useful information, recall it later, and use reflect or consolidation to turn accumulated memories into reusable insights. Smart retain can assess importance before saving. Deduplication can classify a new item as an add, update, or no-op when it resembles existing content.

## How it works

Kirok stores data in a SQLite database at `~/.kirok/memory.db` by default. SQLite WAL mode supports the local persistence layer, while FTS5 supplies BM25 keyword search and `sqlite-vec` supplies per-bank vector KNN. If the native vector extension cannot load, the server uses a NumPy brute-force scan instead.

Recall runs semantic and keyword searches and combines their rankings with Reciprocal Rank Fusion. Observations are presented before ordinary memories when they match. Semantic results use configurable similarity floors, while keyword hits are not subject to the semantic threshold.

Google Gemini handles embeddings, entity extraction, reflection, and consolidation. The documented defaults use `gemini-embedding-001` for 3072-dimensional embeddings and `gemini-2.5-flash-lite` for language-model tasks. Because these operations use the Gemini API, the Kirok Memory MCP server is not fully on-device.

A background consolidation loop can synthesize pending memories into observations. Background failures do not block a retain operation, and destructive LLM decisions are soft-deleted with an audit trail. Startup snapshots can also be enabled and rotated according to configuration.

## Setup and configuration

Kirok requires Python 3.12 or newer, `uv`, and a Google Gemini API key. The package is available through PyPI, so a typical client can launch it with `uvx kirok-mcp`. Store the key as `GEMINI_API_KEY` in `~/.kirok/.env`, or provide it in the MCP client configuration; a client-level environment value takes precedence.

Run `uvx --from kirok-mcp kirok-doctor` to perform an offline setup check. For development, clone the repository, run `uv sync`, configure `.env`, and launch with `uv run kirok-mcp`. The server communicates over stdio using JSON-RPC 2.0.

Available settings include the database path, deduplication threshold, recall similarity floors, consolidation batch size and timeout, reflection timeout, and automatic snapshot retention. The bundled skill at `skills/kirok/SKILL.md` can guide an agent on when to use the memory tools.

## Tools and capabilities

Core tools include:

- `KIROK_retain`, `KIROK_recall`, `KIROK_reflect`, `KIROK_smart_retain`, and `KIROK_consolidate`
- Memory retrieval, browsing, editing, and deletion through `KIROK_get_memory`, `KIROK_list_memories`, `KIROK_update_memory`, and `KIROK_forget`
- Mental-model listing, inspection, refresh, and deletion
- Bank listing, statistics, clearing, deletion, and per-bank configuration

Bank clearing and deletion require explicit confirmation; without it, the tools preview the operation. Memory and mental-model deletion are irreversible according to the documented tool behavior.

## Limitations and notes

The server depends on Google Gemini for embedding and language-model operations, so it does not meet a requirement that all data processing remain local. The database itself is stored locally and can be placed elsewhere with `KIROK_DB_PATH`.

The documented server uses stdio rather than a hosted HTTP endpoint. Native `sqlite-vec` may be unavailable in some environments, although the NumPy fallback preserves the documented search behavior. The project lists Python 3.12+ as a requirement, and the Gemini API key is required for operation.

_Full upstream README: https://allmcps.com/mcp/kirok-memory/readme_

