kindex

The memory layer AI coding agents don't have.

Kindex does one thing. It knows what you know. A persistent knowledge graph so Claude Code, Codex, Gemini CLI, OpenCode, Cursor, and other MCP-capable agents never start blind.

$ pip install 'kindex[mcp]'
$ uv tool install 'kindex[mcp]'
$ git clone https://github.com/jmcentire/kindex && cd kindex && make install
v0.23.0 MCP Plugin 52 MCP Tools 69 CLI Commands MIT License Free

Why Kindex

Memory plugins capture what happened. Kindex captures what it means and how it connects.

Most memory tools are session archives with search. Kindex is a weighted knowledge graph that grows intelligence over time — understanding relationships, surfacing constraints, and managing exactly how much context to inject based on your available token budget.

Context-Aware by Design

Five context tiers auto-select based on available tokens. When other plugins dump everything into context, Kindex gives you 200 tokens of executive summary or 4000 tokens of deep context — whatever fits. Your plugin doesn't eat the context window.

Knowledge Graph, Not Log File

Nodes have types, weights, domains, and audiences. Edges carry provenance and decay over time. The graph understands what matters — not just what was said.

Operational Guardrails

Constraints block deploys. Directives encode preferences. Watches flag attention items. Checkpoints run pre-flight. No other memory plugin has this.

Cache-Optimized LLM Retrieval

Three-tier prompt architecture with Anthropic prompt caching. Stable knowledge cached at 10% cost. Query-relevant context predicted via graph expansion. Only the question pays full price. Transparent — kin ask just works better and cheaper.

Team & Org Ready

.kin inheritance chains let a service repo inherit from a platform context, which inherits from an org voice. Private/team/org/public scoping with PII stripping on export.

Session Tags

Named work context handles that replace manual resume files. Start a tag, track focus and remaining items, segment by topic, and resume seamlessly in new sessions. kin tag start / kin tag resume.

Reminders & Actions

Natural language scheduling with recurring support. Reminders can carry shell commands and Claude instructions — the daemon executes them automatically when due. When explicitly enabled, a Stop hook guard can block session exit for actionable reminders. kin remind create "deploy" --at "in 1h" --action "...".

Adaptive Scheduling

The cron daemon dynamically adjusts its check interval based on the nearest pending reminder. Reminder in 3 days? Check daily. Day of? Hourly. Within the hour? Every 5 minutes. No reminders? Daemon sleeps. Zero wasted cycles.

Policy-Aware Editing

Edit nodes in place without losing history. Concepts and documents edit freely; decisions and constraints only grow (append) or get superseded with a linked replacement. Every edit logs per-field value diffs. kin edit / kin supersede.

Graph Profiles

One machine, multiple sequestered graphs — work and personal knowledge never mix. Profiles resolve by flag, env, project config, or directory roots, and each database is stamped so a wrong path can't cross-contaminate. kin profile create work --data-dir ~/.kindex-work.

Multi-Agent Collab

Agents join shared conversations with unread tracking, targeted messages, standing inject messages pushed into members' context, and advisory locks on shared resources. coord_join / coord_inject / lock_acquire.

Getting Claude to Actually Use It

Installing tools is not enough. Claude won't use them proactively unless you tell it to.

Kindex ships with a recommended CLAUDE.md block that turns passive tools into active habits. The difference between "Claude has a knowledge graph" and "Claude actively maintains a knowledge graph" is one command.

# Print the recommended CLAUDE.md directives $ kin setup-claude-md # Or auto-append to ~/.claude/CLAUDE.md $ kin setup-claude-md --install # Install lifecycle hooks $ kin setup-hooks

The directives add:

Session Lifecycle

Start/segment/end rules so Claude tags every session and tracks context across conversations.

Capture Triggers

Explicit rules for what to add: discoveries, decisions, key files, notable outputs, new terms, open questions.

Search Discipline

Always search before add. Always check existing knowledge before starting work. No duplicates.

Bulk Extraction

Use learn after reading long files or completing complex tasks to auto-extract and index concepts.

The SessionStart hook reinforces these directives at every session start and after context compaction, so Claude never forgets.

In Practice

A 162-file fantasy novel vault — characters, locations, magic systems, plot outlines — ingested in one pass. Cross-referenced by content mentions. Searched in milliseconds.

$ kin status Nodes: 192 Edges: 11,802 Orphans: 3 $ time kin search "the Baker" # Kindex: 10 results for "the Baker" ## [document] The Baker - Hessa's Profile and Message Broker System (w=0.70) → Thieves Guild, Five Marks, Thieves Guild Operations ## [document] Hessa the Baker's Story (w=0.70) → Mia -- Backstory, Mia -- Character Arc ## [person] Mia and The Baker (Hessa) -- Relationship (w=0.70) → Sebastian and Mia, Mia -- Motivations and Goals 0.142 total $ kin graph stats Nodes: 192 Edges: 11,802 Density: 0.3218 Components: 5 Avg degree: 122.94

192 nodes. 11,802 edges. 5 context tiers. Hybrid FTS5 + graph traversal in 142ms.

Install as Agent MCP Plugin

Claude Code, Codex, Gemini CLI, OpenCode, Cursor, and other MCP-capable agents get native tools for your knowledge graph. Pick whichever installer you already use — pip, uv tool, uvx, or git clone && make install.

# Claude Code $ claude mcp add --scope user --transport stdio kindex -- kin-mcp $ kin init # Codex $ kin setup-codex-mcp $ kin setup-agents-md --install --global # Gemini CLI $ kin setup-gemini-mcp $ kin setup-gemini-md --install # OpenCode (also reads AGENTS.md) $ kin setup-opencode-mcp # Cursor $ kin setup-cursor-mcp $ kin setup-cursor-rules --install # That's it. Your agent now has: search — hybrid FTS5 + graph search add — capture knowledge with auto-linking context — formatted context block at any tier show — full node details with edges ask — question classification + answer learn — extract knowledge from text link — create edges between nodes edit — policy-aware in-place edit with value diffs supersede — replace a node, preserving history list_nodes — browse with filters status — graph health + operational summary suggest — bridge opportunity suggestions graph_stats — centrality, communities, density changelog — recent changes ingest — ingest from external sources tag_start — start a named session tag tag_update — update/segment/pause/end a session tag tag_resume — resume a session with full context remind_create — create a reminder with NL scheduling remind_list — list active reminders remind_snooze — snooze a reminder remind_done — complete a reminder remind_check — fire due reminders now remind_exec — execute a reminder's action coord_join — join a multi-agent collab conversation coord_attach — attach a node as a shared resource coord_inject — standing messages pushed to members' context lock_acquire — advisory lock on a node (TTL, expiring) lock_release — release an advisory lock

Or add .mcp.json to any repo for project-scope access:

{ "mcpServers": { "kindex": { "command": "kin-mcp" } } }

Also works as a standalone CLI (kin search, kin add, etc.) and via Claude Code hooks. Use whichever integration fits your workflow.

Context Tiers

The core differentiator. Other plugins inject context and hope for the best. Kindex manages exactly how much based on what's available.

TierBudgetUse Case
full~4000 tokensSession start, deep work — everything relevant
abridged~1500 tokensMid-session reference — key facts and connections
summarized~750 tokensQuick orientation — what matters right now
executive~200 tokensPost-compaction — just the essentials
index~100 tokensExistence check — "I know about X"

Auto-selected via --tokens budget or set explicitly with --level. The MCP context tool does this automatically.

Quick Start (CLI)

# Initialize a knowledge store $ kin init # Add knowledge $ kin add "Stigmergy is coordination through environmental traces" Created node: stigmergy-is-coordination-th (concept) # Search with hybrid FTS5 + graph traversal $ kin search stigmergy 0.85 stigmergy-is-coordination-th concept Stigmergy is coordination... # Ask questions (with automatic classification) $ kin ask "How does weight decay work?" [procedural question] # Track operational rules $ kin add "Never break the API contract" --type constraint --trigger pre-deploy # Ingest from all sources (GitHub, git, sessions, files) $ kin ingest all

Architecture

SQLite + FTS5 primary store and full-text search nodes: id, title, content, type, weight, audience, domains, extra edges: from_id, to_id, type, weight, provenance fts5: content synced via triggers Retrieval pipeline: FTS5 BM25 ──┐ Graph BFS ──┼── RRF merge ── tier formatter ── context block (vectors) ──┘ | │ full | abridged | summarized | executive | index Embedding providers (configurable): local (sentence-transformers) | openai | gemini LLM cache tiers (kin ask): Tier 1: codebook (stable node index) cached @ 10% cost Tier 2: query-relevant context cached per-topic @ 10% cost Tier 3: user question full price, tiny Reminders: reminders table (SQLite) separate from knowledge graph Time parsing: dateparser (NL) + dateutil.rrule (recurrence) + cronsim (cron) Channels: system (macOS) | slack | email | claude (hook) | terminal Daemon: launchd/cron adaptive interval ── check due ── notify ── auto-snooze Scheduling: adaptive tiers (>7d=daily, >1d=hourly, >1h=10min, <1h=5min, none=disabled) Actions: shell commands run directly | complex tasks launch claude -p Stop guard: optional block when actionable reminders are pending Three integration paths: MCP plugin ──> Claude calls tools natively (search, add, learn, remind, ...) CLI hooks ──> SessionStart/PreCompact/Stop lifecycle events Adapters ──> Entry-point discovery for custom ingestion sources

Node Types

Knowledge: concept, document, session, person, project, decision, question, artifact, skill

Operational: constraint (invariants), directive (soft rules), checkpoint (pre-flight checks), watch (attention flags)

.kin Project Contract

Repos ship .kin/ with the code: project context, inheritance, graph snapshots, and optional work policy. Private runtime state stays in ~/.kindex or ignored .kin/local directories.

Org Voice

# ~/.kindex/voices/acme.kin name: acme-voice audience: org voice: tone: precise, direct principles: - Explain reasoning - Be honest about trade-offs standards: code_review: - Every PR needs a "why"

Platform Team

# platform/.kin/config name: platform audience: org domains: [engineering] inherits: - ~/.kindex/voices/acme.kin

Service Repo

# payments-service/.kin/config name: payments-service audience: team domains: [payments, python] inherits: - ../platform/.kin/config work_policy: require_active_tag: true linear: enabled: true require_issue: true team: ENG

The payments service gets inherited voice and standards plus its own policy. Linear enforcement is opt-in: personal projects leave work_policy.linear.enabled false or absent. Kindex resolves config from --project-path, KIN_PROJECT, git root, then cwd. Example voice files included.

Integrations

GitHub

Ingest issues, PRs, and commits via gh CLI.

Linear

Ingest issues via GraphQL API; enforcement only runs when project policy opts in.

Git Hooks

Pre-commit/pre-push can enforce opt-in project policy; post-commit records context.

File Watcher

SHA-256 change detection for registered files.

CLI Reference

69 commands organized by function. All support --data-dir, --config, --profile, and --json flags.

Core

kin search <query>Hybrid FTS5 + graph search with RRF merging
kin contextFormatted context block for AI injection (--level, --tokens)
kin add <text>Quick capture with auto-extraction and linking
kin show <id>Full node details with edges, provenance, and state
kin listList nodes (--type, --status, --mine, --limit)
kin ask <question>Question classification + LLM or context answer

Knowledge Management

kin learnExtract knowledge from sessions and inbox
kin link <a> <b>Create weighted edge between nodes
kin edit <id>Policy-aware in-place edit (--title, --content, --append, --expires)
kin supersede <id> <text>Replace a node with a new one, preserving history
kin alias <id>Manage AKA/synonyms for a node
kin register <id> <path>Associate a file path with a node
kin orphansNodes with no connections
kin trail <id>Temporal history and provenance chain
kin decayApply weight decay to stale nodes/edges
kin recentRecently active nodes
kin tag [action]Session tags: start, update, segment, pause, end, resume, list, show
kin remind [action]Reminders: create, list, show, snooze, done, cancel, check, exec

Graph Analytics

kin graph [mode]Dashboard: stats, centrality, communities, bridges, trailheads
kin suggestBridge opportunity suggestions (--accept, --reject)
kin skills [person]Skill profile and expertise for a person
kin embedIndex all nodes for vector similarity search

Operational

kin statusGraph health + operational summary (--trigger, --owner)
kin set-audience <id>Set privacy scope (private/team/org/public)
kin set-state <id> <k> <v>Set mutable state on directives/watches
kin exportAudience-aware graph export with PII stripping
kin import <file>Import nodes/edges from JSON/JSONL
kin sync-linksUpdate node content with connection references

Collab & Multi-Agent

kin coord [action]Agent coordination: start, post, read, list, end, join, attach, inject
kin lock <id>Acquire an advisory lock on a node (--ttl, --note, --force)
kin unlock <id>Release an advisory lock (--force for foreign locks)
kin profile [action]Named graph profiles: list, which, create

Ingestion

kin ingest <source>Ingest from: projects, sessions, files, commits, github, linear, all
kin cronOne-shot maintenance cycle (for crontab/launchd)
kin watchWatch for new sessions and ingest (--interval)
kin analyticsArchive session analytics and activity heatmap
kin indexWrite .kin/index.json for git tracking

Infrastructure

kin initInitialize data directory
kin config [show|get|set]View or edit configuration
kin policy [show|check]Show/check project work policy from tracked .kin/config
kin setup-hooksInstall lifecycle hooks into Claude Code
kin setup-codex-mcpInstall kindex MCP server into Codex
kin setup-gemini-mcpInstall kindex MCP server into Gemini CLI
kin setup-opencode-mcpInstall kindex MCP server into OpenCode
kin setup-cursor-mcpInstall kindex MCP server into Cursor
kin setup-cronInstall periodic maintenance (launchd/crontab)
kin setup-claude-mdOutput/install recommended CLAUDE.md directives
kin setup-agents-mdOutput/install AGENTS.md directives (Codex, OpenCode)
kin setup-gemini-mdOutput/install GEMINI.md directives
kin setup-cursor-rulesOutput/install Cursor rule (.mdc) for kindex
kin stop-guardStop hook guard for actionable reminders
kin doctorHealth check with graph enforcement
kin migrateImport markdown topics into SQLite
kin budgetLLM spend tracking
kin whoamiShow current user identity
kin changelogWhat changed (--since, --days, --actor)
kin logRecent activity log
kin git-hookInstall/uninstall git hooks in a repository
kin primeGenerate context for SessionStart hook (--codebook)
kin compact-hookPre-compact knowledge capture