
Kindex
io.github.wandercom由 GitHub 账号 wandercom 发布v0.53.0更新于 Nov 6, 2026
Persistent knowledge graph and MCP server for AI workflows with git-tracked project context.
概览
Kindex 是本地、受 git 跟踪的 AI 工作流知识图谱,通过 50 多个 MCP 工具让助手搜索、添加、关联和整合项目记忆。
- 可以做什么
- 搜索、读取并注入上下文:全文与图谱混合检索、格式化上下文块、节点详情、基于带日期证据的问答。
- 采集与整理知识:添加节点、编辑、替换、建立关联、别名、验证、作废、审核隔离候选、合并重复项。
- 组织工作:会话标签、提醒、对话模式、任务、多代理协作与节点建议锁。
- 分析与维护图谱:统计、中心性、社区、建议、变更日志、健康检查、向量嵌入与归档维护。
- 导入与导出:摄取项目、会话、文件、提交、GitHub 与 Linear 来源;按受众范围导出并剥离个人信息。
- 适用场景
- 适合希望助手在多次会话和多个仓库之间保留可检索的持久项目记忆,或让多个编码代理共用同一本地图谱的场景。面向需要上下文预热、会话捕获与知识整合的开发者,而非托管服务。
- 运行要求
- 以 stdio 本地进程运行;需用 pip、uv tool、uvx 或源码安装带 mcp 扩展的 kindex 包,并执行 kin init。若走 Claude Code 插件路径且 PATH 中没有 kin-mcp,则需要 uv。可选扩展提供 LLM 抽取、向量检索和自然语言提醒,使用这些功能需配置 LLM 或嵌入服务提供方。
安装
在 SourceWeft 中
- 打开 控制台中的 Kindex,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Kindex
[Python 3.10+] [License: BSL 1.1] [v0.53.0] [PyPI] [MCP Market] [Tests] [MCP Plugin]
Every agent is smart inside its own silo. Kindex lets them work together.
Kindex does one thing. It knows what you know.
Claude Code, Codex, Gemini CLI, Google Antigravity, OpenCode, Cursor, and other MCP-capable agents each remember for themselves, and none of them can read the others. Kindex is the local knowledge graph they all read and write: continuity across sessions and restarts, handoffs between vendors, shared decisions and constraints, and live coordination while several of them work at once. Available as a free MCP plugin or standalone CLI.
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 with typed nodes, provenance, and decay, that surfaces constraints and decisions and manages exactly how much context to inject based on your available token budget.
Kindex is the index for an individual and a codebase: your own graph, and the repository's git-tracked .kin/. Kinbase is the company product above it, in development: engineering direction, architecture, standards, ownership, and history, held by named authorities and composed into every coding session. Same engine, same protocol, physically separate stores.
Docs: kindex.tools is the canonical public site, served by the companion Fly static app. This repo also publishes its docs/ directory at wandercom.github.io/kindex. Human setup lives in docs/human-guide.md; agent operating rules live in docs/mcp-agent-guide.md.
Install
Development preview: Claude function hooks and signet-eval coexistence
adds repo-local durable tasks, secret minimization at Kindex-owned boundaries,
and separately selectable modern/legacy adapters. The default remains compatible
legacy hooks. The modern adapter is a Claude Code mod: it installs on Claude Code
2.1.287 or newer when that host's claude plugin validate accepts it (last
verified on 2.1.288). This is not a promise that all Claude logs can be redacted
or a published 1.0 release.
Pick whichever installer you already use. They all install the same kin and kin-mcp binaries.
Upgrading to v0.36.0
[!WARNING] Before upgrading, stop every Kindex daemon, MCP server, and older CLI process. A v0.35.x process does not reject schema v12 and can write non-canonical session paths after migration.
Dream is Kindex's background knowledge-consolidation pass: it finds related
nodes, safely merges strong duplicates, and stages weaker links for review.
The first v0.36.0 process to open an older graph creates a transaction-safe
pre-migration snapshot under
$XDG_STATE_HOME/kindex/snapshots/<db>-<hash>/migrations/ (defaulting below
~/.local/state/kindex/snapshots/) before atomically migrating schema v11 to
v12. The owner-private snapshot passes SQLite integrity and source-version
checks, and a partial file is deleted if creation or validation fails.
Concurrent v0.36+ processes serialize this step through a dedicated
rollback-journal SQLite lock and recheck the schema after waiting. Migration
recovery points are retained outside the rotating ten-file
automated-merge snapshot pool. Older duplicate active session tags become paused
history, one active tag per normalized project and name is enforced, and Dream
suggestions carry an explicit title-or-node-ID identity contract and title
ambiguity is refused. No node or edge rows are deleted; legacy
domain-co-membership edges remain available as stored history but no longer
participate in semantic traversal or health metrics. kin status exposes the
durably recorded recovery path; normal stores also record it in kin changelog.
Rolling back the schema migration
Do not open the migrated database with v0.35.x: that version has no forward-schema guard and can write old, non-canonical session identity. Instead:
- While v0.36 is still installed, run
kin statusand record theRecoverypath. It names the latest validated migration attempt; older attempts remain in the samemigrations/directory. - Stop every Kindex process again.
- Move the live database's
-waland-shmsidecars aside. - Copy the recorded snapshot over the live database.
- Only then install or run v0.35.x and verify the graph.
This differs from recovering a bad automated merge,
which does not change package versions. Graph-health consumers must also
recalibrate: existing node/edge/orphan/component outputs now describe the
semantic graph, while explicit stored counts expose retained lifecycle and
legacy rows. Machine-readable stats identify this contract as metrics_schema: 2.
Then initialize the graph:
Extras — combine in one install ('kindex[mcp,llm,reminders]') or use 'kindex[all]':
Homebrew and apt packages aren't published yet. Use
pip,uv tool,uvx, or source until they are.
Install as Agent MCP Plugin
Each agent reads MCP servers from a different config file. The kin setup-*-mcp commands write the right shape into the right path; the manual snippet is shown alongside in case you'd rather edit the file yourself.
Claude Code
As a plugin (MCP server, skills, and session hooks in one install):
or, inside a session, /plugin install kindex --marketplace wandercom/kindex.
What the plugin runs:
- MCP server (
scripts/claude-plugin/kin-mcp): your installedkin-mcpwhen one is onPATH, so the server and thekinCLI share one version and one database. Otherwise it runs the matching PyPI release withuvx --from 'kindex[mcp]==<version>' kin-mcp, which downloads kindex and its dependencies from PyPI once and caches them. That needs uv; without uv or kindex it exits with an install hint. - Hooks (
hooks/hooks.json, throughscripts/claude-plugin/kin): session start, prompt submit, pre-tool-use, pre-compact and stop call your installedkinto prime context, check prompts against the graph and capture the session. Without an installedkinthey do nothing. They source~/.profilefirst so akininstalled by pipx, uv or Homebrew is found. - Skills:
kindex-prime,kindex-capture,kindex-learn.
Everything stays on your machine: the graph is a local SQLite database
(~/.kindex/ and per-repo .kin/). Nothing is sent anywhere unless you
configure an LLM or embedding provider (see Privacy).
Or as a bare MCP server:
Or add .mcp.json to any repo to register the server for that project:
Registration scope does not restrict graph access. For an agent that should use
only one repository's memory, run kindex-lite --repo /absolute/path/to/repo
instead. It binds the MCP server to that repository's .kin graph and Kinbase
reads, without global-graph fallback. Kinbase submission and write-capable status
require the launcher's --allow-kinbase-submit; --no-kinbase omits Kinbase entirely.
See repository-bound MCP
for configuration and the isolation boundary.
The MCP server exposes 50+ native tools to supported clients: search, add, context, show, ask, learn, link, edit, supersede, list_nodes, status, suggest, candidate_*, verify, invalidate, stale_check, graph_stats, graph_merge, dream, changelog, ingest, tag_start, tag_update, tag_resume, query_context, task_claim, coord_*, lock_acquire, lock_release, remind_*, mode_*, and more.
For explicitly scoped read-only query preparation and optional additive retained
evidence, see query context. The supported pilot paths
are kin context-query and full MCP query_context.
Offline recall cues are an experimental, disabled-by-default lexical sidecar.
Explicitly prepare a bounded batch with kin recall-cues build --limit 100
(repeat --node ID to select sources), and inspect counts with
kin recall-cues status; both accept the shared --config, --data-dir,
--profile and --json flags after the subcommand. MCP exposes the same
operations as recall_cues_build(node_ids=None, limit=100) and
recall_cues_status().
Enable supplemental retrieval in your selected configuration:
Builds make no provider calls and change only derived metadata. Each source
gets at most three aliases or framed exact source spans; source alias origin
does not assert human authorship. The index uses only the supporting source
wording, while answers and context receive only original source nodes. This
extractive arm cannot invent missing synonyms or demonstrate personalized
memory benefits. It has an additional candidate/index budget, so compare it
with ordinary retrieval explicitly. Source changes invalidate cues immediately;
run an explicit bounded rebuild to refresh them. Roll back retrieval by setting
enabled: false; stored sidecars remain available for later rebuilding. There
is no automatic maintenance, generation service, or background scheduling.
For coding agents, install both the MCP server and the instruction file. The
instruction file tells the model how to use kindex: start a session tag, read
tracked .kin/config, check project policy, search before adding, capture
durable decisions, and end the tag with a summary.
Codex
setup-codex-hooks installs a SessionStart hook (alongside the prompt/tool attention hooks), so Codex begins each session with the same auto-primed context and "use kindex" / .kin directive as Claude Code. Codex runs new or changed hooks only after you trust them, at its startup review prompt or in /hooks; until then it does not run them, SessionStart included.
Or hand-edit ~/.codex/config.toml:
Gemini CLI
Or hand-edit ~/.gemini/settings.json:
Google Antigravity
setup-antigravity-mcp writes the standalone MCP config shape used by
Antigravity's editor/shared config and CLI config. setup-antigravity-hooks
installs PreInvocation priming/prompt checks, PreToolUse advisory attention and
permission gating for Kindex config writes, and Stop-time reinforcement enqueue.
Or hand-edit ~/.gemini/config/mcp_config.json and
~/.gemini/antigravity-cli/mcp_config.json:
Muse
Muse reads ~/.config/muse/settings.json (camelCase mcpServers; never add a
legacy mcp_servers key, which makes Muse drop every MCP server). Muse already
loads Claude Code and Codex personal rules, so kin setup-agents-md --install --global
covers its directives. Muse does not run Claude or Codex hooks, and Kindex does
not yet install Muse-native hooks. Or hand-edit:
OpenCode
Or hand-edit ~/.config/opencode/opencode.json:
OpenCode reads AGENTS.md natively, so install the MCP server and the shared AGENTS.md instructions together.
The OpenCode plugin supplies periodic supervisor advice on the primary user message. See supervision and independent health for configuration and notification setup.
Cursor
Or hand-edit ~/.cursor/mcp.json:
Cursor integration includes MCP, always-applied rules, and native supervisor hooks. The adapter has automated boundary coverage; authenticated Cursor model delivery and IDE activity discovery remain unverified. No Cursor account is needed to use Kindex with the other supported agents. See supervision and independent health.
Remote agents (HTTPS behind Cloudflare Access)
kindex-remote (extra kindex[remote]) serves your graph over streamable HTTP
to agents on other machines. It listens on loopback only; a Cloudflare Tunnel
publishes it and a Cloudflare Access application authenticates every caller:
Managed OAuth for interactive agents (Claude Code, Codex, claude.ai connectors)
and a service token for headless ones. The server also verifies the Access JWT
(Cf-Access-Jwt-Assertion: signature, audience, issuer) on every request.
Only graph tools are served (search, context, add/edit/learn/link, tasks, tags,
coordination, watches, ask). Tools that run commands, read host paths or ingest
from the host (reminders, ingest, modes, maintenance, Kinbase, task_execute)
are not, nor is graph_stats. add accepts only URL referents, task tools
refuse project_path, and show does not resolve saved sources. Tool calls run
one at a time on a worker thread, off the request loop.
The Access application needs Managed OAuth with dynamic client registration
enabled (and the client's callback URLs allowed) for interactive agents. Connect
one with claude mcp add --transport http kindex https://app.example.com/mcp
(OAuth opens a browser once); a headless client sends CF-Access-Client-Id and
CF-Access-Client-Secret headers instead.
Why Kindex
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.
Answers from dated evidence
kin ask answers in one model call from dated evidence: the matching nodes in chronological order with today's date and your standing directives, trimmed to the messages that bear on the question, within a small budget for a single fact and a wider one for counts, lists, orderings, summaries and advice. Conversation facts and per-person profiles written by kin digest let it answer from a few thousand tokens, and relative dates in the evidence arrive already resolved. With conversations.claims: true in your config, kin digest records turn-level claims instead of per-conversation facts, each tied to the message it came from (its place in the conversation and its words); kin digest --claims converts conversations digested earlier. In a terminal the answer streams as it is written. The answer rules cover updated values, counts across conversations, date arithmetic and missing details. The defaults suit an agent asking about its own graph: today's date is the clock's (or --as-of), reasoning effort is ask.effort (medium), and a question that gets a version, name or date wrong is told what the record says. ask.preset: benchmark restores the configuration the published LoCoMo, LongMemEval-S and BEAM scores were measured with (docs/benchmarks/); pass each question's date with --as-of to reproduce them. A directive kin digest reads from an imported chat applies once you confirm it (kin set-state <id> confirmed true), and conversations.profiles: true also writes per-person profiles. kin ingest conversations --directory DIR stores chat transcripts without loss for it to search. The MCP ask tool returns the same dated evidence to the agent that called it (and drafts the answer itself with answer=true); context(level="evidence") returns it for a topic.
Claim revisions include source expiry, so changing or removing an expiry refreshes derived claims on the next requested claims backfill. Retraction also clears that conversation's claim revision, allowing an identical re-import to regenerate claims. Older revision keys refresh once on the next explicit kin digest --claims, including conversations without expiry; this can use the configured model budget. Claims remain off by default, and upgrading does not start a backfill.
Team and 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. Enterprise-ready from day one.
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.
192 nodes. 11,802 edges. 5 context tiers. Hybrid FTS5 + graph traversal in 142ms.
Getting Agents to Actually Use It
Installing the MCP plugin gives the agent the tools. But agents won't use them proactively unless you tell them to. Kindex ships with recommended instruction blocks that turn passive tools into active habits. For the full agent playbook, see docs/mcp-agent-guide.md.
This adds session lifecycle rules (start/orient/during/segment/end), explicit capture triggers (discoveries, decisions, tasks, key files, notable outputs), and search-before-add discipline. The difference between "the agent has a knowledge graph" and "the agent actively maintains a knowledge graph" is this block.
For durable work, agents should use Kindex's persistent task and knowledge
surfaces rather than host-session-only task state. Use task_add, task_list,
and task_done for work that must survive the current conversation; search
before adding knowledge; prefer edit or supersede over duplicate nodes; and
treat tracked .kin files as shipped project state, not local cache.
If the host also exposes session-local task tools, use those only for temporary
planning; durable work belongs in Kindex.
For MCP clients in a repository, retain either project- or global-qualified
references when reads supply them, and pass them unchanged to follow-up tools.
In dual-graph sessions, use those qualified evidence IDs in source_refs when
a new node or task derives from existing knowledge. Ordinary single-store and
profile responses keep legacy raw IDs; source_refs does not accept those raw
IDs. Search again after restarting the MCP server because qualified reference
tokens are bound to its store selection. See Profiles for read
scopes and write routing.
The Claude SessionStart hook (kin setup-hooks) and Codex hooks (kin setup-codex-hooks) reinforce these directives at the start of supported sessions with a "Session directives" block that reminds the agent to use kindex MCP tools throughout the session.
What gets captured
With the directives active, the agent will:
- Search the graph before starting work and before adding nodes
- Add discoveries, decisions, key files, notable outputs, and new terms as they emerge
- Link related concepts when connections are found
- Learn from long files and outputs via bulk extraction
- Tag sessions to track work context across conversations
- Remind with actions for deferred tasks (shell commands or headless agent wakeups)
Actionable Reminders
Reminders can carry shell commands, natural-language instructions, or a headless agent wakeup. Codex, Claude, Antigravity, Cursor, OpenCode and Muse can start or resume a turn using their documented CLI surfaces. Explicit session IDs and the creation-time working directory are preserved. Codex can queue to the same session after a recognized active-writer conflict; queue acceptance is not execution confirmation. Other clients offer headless resume, not live injection.
Notifications default to an output channel writing to /dev/null, independently
of wakes. Set reminders.output_destination or --destination to an absolute
file/device path, fd:N, or an HTTP(S) POST endpoint. Output failures never trigger
terminal/system fallback. Existing explicit channel configurations remain valid.
See notification routing for supported transports,
configuration, failure states, and migration guidance.
remind_create stores the reminder. A later kin remind check, kin remind exec,
kin cron, or installed kin setup-cron schedule must run it. No UI automation or
permission bypass is used. last is pinned when the reminder is created, never
resolved at firing time.
Hook-time reminder injection uses a scoped reminder board. When a client supplies a chat/session id (conversation_id, chat_id, session_id, CLAUDE_SESSION_ID, CODEX_SESSION_ID, OPENCODE_SESSION_ID, CURSOR_SESSION_ID, etc.), Kindex injects only reminders scoped to that id plus reminders explicitly marked --scope global. Legacy unscoped reminders still work for manual kin prompt-check, daemon checks, and notifications, but they are not injected into an identified chat by default.
Dream — Knowledge Consolidation
Kindex can run fuzzy deduplication, auto-apply high-confidence pending suggestions, and stage bounded domain-link proposals for review. Resolved fuzzy matches are not recreated. The pending domain-review queue is capped per graph (reminders.dream_max_domain_link_suggestions, 50 by default), proposals are round-robin across domains, and rejected pairs stay rejected. The setting lives under reminders because scheduled and Stop-hook Dream runs use the reminder/maintenance configuration. Shared domains are never materialized directly as semantic edges. Like memory consolidation during sleep — replay important paths and prune noise without turning tags into topology.
Default triggers are manual CLI, periodic cron (step 11 of kin cron), and a throttled detached Stop hook. File locking prevents concurrent cycles, and reminders.dream_min_interval prevents hooks or cron from relaunching dream repeatedly after a recent start. Set reminders.dream_on_stop_enabled: false to disable Stop-time detached dream while leaving manual and cron dream available.
Conversation Modes
Modes are reusable conversation-priming artifacts that induce a processing mode in an AI session. Based on research showing that induced understanding outperforms direct instruction by 5.4x, and that 15 tokens of mode-setting capture 98.8% of achievable priming benefit.
Five built-in modes: collaborate, code, create, research, chat. Create custom modes from any session and export them for team sharing (PII-free).
Modes are not instructions — they're state inductions. A primer establishes how to think, a boundary defines what quality means, and permissions state what's allowed. The AI shifts processing mode rather than following a checklist.
Quick Start
Trust, Capture Review, and Bounded Resume
Kindex keeps automatic extraction separate from durable knowledge. The pre-compact hook stages review candidates; it does not create graph nodes or edges. Inspect and resolve candidates explicitly:
The review token detects changes between show and accept. It is not authentication, authorization, or proof of reviewer identity. Candidate source text is retained only as a SHA-256 digest, and accepted, rejected, or expired candidates are reduced to minimal receipts. Human candidate output is visibly delimited because its content is untrusted.
Verification is also explicit and records asserted local audit text:
Trusted-only search/context and kin tag resume admit only active, explicitly
verified, currently valid, non-contradicted knowledge. Resume output includes an
authority warning and machine-reason omission counts. Its legacy --tokens
option is an exact UTF-8 byte budget by default; direct library callers can pass
a provider's exact token counter when they require a provider-token guarantee.
Non-positive resume budgets return no output.
Referent Binding and Verifiable Staleness
A node can bind the external thing its claim describes — a file, URL, or repo
state — with a content digest and two clocks: asserted_at (when the claim was
made) and true_of (when the referent was observed in the digested state).
Staleness then stops being a heuristic and becomes a measurement:
Detection never deletes or rewrites content: a stale claim stays recallable,
visibly marked [stale-referent] in search and context output, and drops out
of --trusted-only projections until re-verified. URL and repo-scope bindings
are recorded with explicit digests (--referent-digest) and surfaced but never
auto-fetched.
Kindex also snapshots the SQLite store (rotating, ten per database) before any
automated destructive merge, so a false graph_merge or dream-cycle merge is
recoverable — see the human guide's restore section.
Automatic candidates expire after seven days by default. Configure a positive retention period in global or project config:
Grounded Retrieval — When the Graph Knows Nothing
Vector search returns the nearest neighbours for any query, however unrelated. Without a floor a near-null question still pulls real nodes into an agent's context, and the graph can never say "I don't know."
Kindex calibrates a similarity floor against your own corpus and reports a verdict with every result set:
The floor is never a config value. It is an immutable, versioned record keyed
by provider:model that carries the corpus it was measured against — node
count, embedding count, sample size, timestamp — so a floor calibrated when 2%
of your graph was embedded is detected as stale rather than silently trusted.
Config holds only the policy:
Verdicts are grounded, weak, ungrounded, and uncalibrated — the last
kept deliberately distinct, because "we have no yardstick" is a different fact
from "we measured and found nothing."
Shadow mode is the default on purpose. Enforcing turns a visible,
self-correcting problem (irrelevant results in context) into a silent one (an
agent proceeding without knowledge that was actually there). Run it in shadow
first, see what it would have dropped, then set enforce: true.
Multi-Hop Reach
Graph expansion honours --hops, with per-hop score decay and a mandatory
beam. The beam's ordering is total and stable, so traversal is reproducible:
adding an edge elsewhere in a hub's neighbourhood cannot silently change what a
query returns.
Extraction Engines
Extraction is an input, never an authority. Engine output lands in the
capture_candidates quarantine and never writes nodes or edges directly.
The gate is two-part: grounding precision is a floor (don't invent), title recall is the discriminator (actually find what a curator would record). Either alone is gameable — an engine that only copies verbatim scores perfect grounding while finding nothing.
An optional LLM-free deterministic engine is available behind an extra:
It is excluded from kindex[all] by design, and degrades to keyword extraction
with a warning when absent. Measure it with kin extract eval before enabling
it; an engine that cannot beat regexes on your corpus has not earned the
install size.
Editing & Superseding
Knowledge changes. Kindex edits are policy-aware: each node type has a mutability class that says how its content may change, so facts stay correctable while history-bearing records stay append-only.
Every edit logs per-field value diffs to the activity log, and kin changelog renders them:
Edits re-embed the node for vector search, protect reserved operational state (locks, claims, coordination messages), and refuse to modify a node another agent has locked unless you pass --force. The per-type class can be overridden in config with edit_policy: {document: additive} if your team wants stricter history.
Profiles
One machine, multiple sequestered graphs. Profiles map names to separate data directories so work and personal knowledge never mix — different DBs, different embeddings, different everything.
Resolution order (first match wins):
--profile <name>flagKIN_PROFILEenvironment variableprofile:key from the project's.kin/configchain- Longest-prefix match of the current directory against profile
roots default_profile- Legacy single graph — no profiles configured means nothing changes
Register the existing legacy graph (usually ~/.kindex) as the default profile before creating others: once a default profile exists, sessions outside all roots route to it, and an unregistered legacy graph stops receiving cron maintenance (kin profile create warns when this would happen).
Stamp guard. Each profile's database is stamped with its profile name on first open. Opening a stamped database under a different profile raises an error instead of silently mixing graphs — a wrong --data-dir can't cross-contaminate.
MCP note. The MCP server binds its profile once at process start and keeps it for the process lifetime. To switch profiles for an agent, restart its MCP server (or run a second server with KIN_PROFILE set in its environment).
Without an active profile or explicit store selection, a present repository-local
.kin/local store becomes the selected graph. Auto reads include that selected
graph and the configured user graph. search, task_list,
context, ask, prime, list_nodes, status, suggest, graph_stats,
graph_heal, changelog, watch_list, and orient accept
graph="auto"|"project"|"global". Auto consults both allowed stores; project
reads only the selected store, including when the user graph is unavailable;
global reads only the configured user store. The fixed kindex://status,
kindex://recent, and kindex://orphans resources use auto scope. An explicit
profile remains a single-store boundary and refuses global scope.
Dual-graph results carry project:<session>:<id> or
global:<session>:<id> references. Ordinary single-store/profile reads retain
raw IDs for legacy compatibility.
Keep the full reference for show, edits, links, task mutations, and watch
resolution. The session token binds it to one MCP store selection; stale
references fail after a restart or graph change. Each graph's hybrid search
keeps its own ranking, and results from both are interleaved by reciprocal
rank. A merged rank is not a calibrated relevance score across databases.
Diagnostics show separate graph sections because edges and components do not
cross stores.
Source-free add, learn, task_add, and watch_add write to the selected
store (the project graph when presence selects it). Set graph="global" for
an explicit outer write in a dual-graph session, or pass current
graph-qualified evidence IDs in source_refs to route a derived
write: any global source routes mixed project/global evidence to the user
graph. source_refs never accepts bare IDs. link_to may accept a bare title
or ID only when it resolves unambiguously; mixed-store links are refused
before creation, and Kindex never creates cross-store edges. A contextual
task_add routed to the user graph inherits the bound selected project path
when project_path is omitted, so default task_list can find it. An explicit
project path wins; scope="global" remains globally visible without inferred
project association. Coordination, modes, session tags, and other selected-only
operational tools do not gain a global mutation mode. Repository and branch
names are relevance context, not authority to write another worktree's graph.
Repository edit_policy applies only when the selected store is that
repository's own canonical .kin/local or declared local store. Explicit
profiles and user/global stores keep the user's edit policy, even when their
data directory happens to be inside the repository tree.
These references are deliberately session scoped, not durable graph identifiers. Broader graph discovery would need a persistent database identity and a binding to its configured global location or live worktree. A repository identity can group related worktrees for retrieval, while the branch and checkout path describe relevance. A removed worktree does not authorize another checkout to write to its graph; rebuilding tracked files with git archive does not recover its untracked .kin/local database.
kin cron runs one maintenance pass per profile and routes session ingestion by roots — sessions whose cwd falls under a profile's roots land in that profile's graph; the default profile takes the unmatched remainder. With no default_profile, a final legacy-remainder pass ingests the unmatched sessions into the legacy graph and keeps its maintenance (reminders, decay, dream) running. kin cron --profile X pins a single pass and keeps routing active — it only ingests the sessions X owns; a bare --data-dir with no resolved profile runs a legacy take-everything pass on exactly that directory. Routing also applies to kin ingest sessions|codex-sessions, the MCP ingest tool, and kin watch. An explicit --data-dir that overrides a profile's data_dir never stamps an unstamped database with the active profile.
Collab
Multiple agents working the same graph can coordinate through conversations with members, read cursors, shared resources, advisory locks, and standing inject messages.
Standing messages expire with the conversation's TTL, and no TTL exceeds 7 days. A member clears only their own standing messages; the creator may clear any.
Agent identity resolves as KIN_AGENT_ID env > agent_id in config > user@shorthost. kin whoami shows both the user and the resolved agent id. Locks, claims, cursors, and message targeting all key off this identity.
Members see their collabs in the session-start prime block:
New targeted/broadcast messages and standing injects also surface mid-session through the prompt hook (with a cooldown so they don't nag). Display is configurable:
Locks are advisory and expire — an expired lock never blocks anyone, and the cron pass sweeps stale locks, conversations, and task claims.
.kin/ Directory & Inheritance
Projects use .kin/ directories that encode their communication style, engineering standards, and values. Teams inherit from orgs. Repos inherit from teams. The knowledge graph carries the voice forward.
The .kin/ directory is the standard location for all kindex project artifacts:
.kin/config— project metadata (voice, domains, audience, inheritance).kin/index.json— graph snapshot for git tracking.kin/code-map.json— repo-relative code map generated bykin export code-map.kin/.gitignore— ignores local-only runtime state under.kin/local,.kin/cache,.kin/tmp, and.kin/private
These files are meant to ship with the code. Do not ignore the whole .kin/
directory in project .gitignore; ignore only local/private subdirectories.
Kindex resolves project config from --project-path, then KIN_PROJECT_PATH,
then KIN_PROJECT, the git worktree root, then the current directory. User
config still lives in ~/.config/kindex/kin.yaml and deep-merges below project
config, so user preferences remain local while the repo's work contract travels
with the repo.
Store selection is ordered: an explicit --project-path, KIN_PROJECT_PATH,
or KIN_PROJECT; then a present .kin/local store; then configured
data_dir; then ~/.kindex. A tracked or symlinked selected local store is
refused explicitly rather than silently falling back to another store.
Generated .kin/ snapshots use canonical, id-keyed ordering and omit volatile
timestamps so repeated exports of unchanged source do not churn Git diffs.
Concurrent branches merge them without manual conflicts via a structured merge
driver that kin index registers automatically on first run (or kin setup-merge
to (re)install it in a fresh clone). .kin/index.json is then unioned by node id
(newer updated_at wins) and .kin/code-map.json by node/edge/layer — lossless
across machines (regenerating from one machine's local DB would drop the other
branch's nodes), with output byte-identical to a fresh kin index. kin merge-kin
is the driver git invokes; repos without it registered fall back to git's default
merge. Never hand-resolve a generated .kin snapshot.
Tracked .kin artifacts must be self-contained and machine-portable: code-map
paths are repo-relative POSIX paths, and task/report metadata must not point at
$HOME, /Users/..., /tmp/..., or another developer-local filesystem
location. If a scanner report is needed as evidence for future work, ship a
repo-local subset or a durable shared artifact rather than a local pointer.
kin export code-map is different from the normal graph export: it projects
current code structure into a small dashboard- and agent-friendly graph of
files, classes, functions, layers, and code dependencies. Use it when a tool
needs the repo's code shape, not the full Kindex knowledge graph.
For code-map output, src/file.py is portable; /Users/alice/repo/src/file.py
and C:\repo\src\file.py are not.
Code-map path requirements:
- Output always uses repo-relative POSIX paths, even when the source machine is Windows.
- Absolute provenance is normalized only when it resolves inside the requested repo root.
- Outside-root, malformed, or unresolved paths are omitted with a safe warning rather than leaked into the artifact.
- Archived nodes are excluded by default because the tracked artifact describes
current code; API callers can opt into
include_archived=Truefor historical analysis.
The payments service gets Acme's voice principles, the platform's engineering standards, AND its own domain context. Local values override ancestors. Lists merge with dedup. Parent directories auto-walk when no explicit inherits is set.
Old-style .kin files (plain YAML) are auto-upgraded to .kin/config on first access.
See examples/kin-voices/ for ready-to-use voice templates.
Architecture
Node Types
Knowledge: concept, document, session, person, project, decision, question, artifact, skill
Code Intelligence
Ingest repository structure with kin ingest code --directory .:
-
Module nodes (artifact) — one per source file with structural summary: classes, public functions, signatures, imports
-
Symbol nodes (concept) — one per class/interface/type with method signatures
-
Edges — imports (
depends_on), inheritance (implements), containment (context_of), call graph (relates_to) -
Three extraction tiers — ctags (100+ languages), cscope (C/C++ cross-refs), tree-sitter (AST call graphs)
-
Resilient fallback — unsupported or untagged files still become module nodes; available tree-sitter parsers can still enrich those modules, with fallback provenance retained in metadata
-
Incremental — file hashing skips unchanged files on re-ingest
-
Unity projects (opt-in) —
--unity(orcode_ingest: {unity: true}in.kin/config) indexes serialized assets (.unity,.prefab,.asset,.mat,.controller,.anim), sniffs text-vs-binary serialization, and attaches each asset's.metaGUID so models can resolve GUID-based references;code_ingest.include_extensionsmaps further extensions (e.g..shader: Unity Shader) -
Project excludes —
code_ingest.excludein.kin/configlists fnmatch globs to leave out, on top of the built-in excludes (tests/*,vendor/*,node_modules/*, Unity'sLibrary/*, and the rest). Patterns match each file's path relative to the git repository root, soclient/Assets/Licensed/*names the same files whether you ingest the root orclient/; outside a repository they are relative to the ingested directory.*crosses/, so*.matmatches at any depth. The next full ingest retires the nodes of files a new pattern covers, the same way it retires deleted files, and leaves anything you archived by hand alone:
Code structure lives in the same graph as your decisions, watches, and constraints. Search finds both what calls a function and what broke last time someone changed it.
Operational: constraint (invariants), directive (soft rules), checkpoint (pre-flight), watch (attention flags)
CLI Reference (70+ commands)
Core
Knowledge Management
Graph Analytics
embedding.provider: voyage uses voyage-context-4 by default. When the
configured model supports contextual chunk embeddings, Kindex stores stable
overlapping chunk vectors and aggregates chunk hits back to the parent node. Use
kin embed plan --stale --kin ./path/.kin to estimate a targeted update,
kin embed enqueue --stale --tags mea to trickle selected work through cron, or
kin embed reindex --target ./repo --limit 100 for a bounded foreground pass.
Unsupported providers/models keep the single-vector strategy unless they later
gain explicit contextual support.
Embedding drains retry transient provider failures. Deterministic input-size
rejections are instead recorded in a local quarantine (embed.quarantine.v1),
so kin embed status can distinguish a drained queue from incomplete vector
coverage without silently discarding the operator diagnostic.
Operational
Collab & Multi-Agent
Ingestion & External Sources
Infrastructure
Configuration
Config is layered like git — global defaults, then global config, then local config. Each layer deep-merges over the previous, so you only set what you want to override.
Use kin config set --global llm.enabled true for global settings, or kin config set llm.model claude-sonnet-4-6 for project-local. Use --project-path /path/to/repo, KIN_PROJECT_PATH=/path/to/repo, or KIN_PROJECT=/path/to/repo when running from outside the repo.
Agent-facing behavior can be tuned at three levels:
agent-config writes only approved behavior keys such as attention.*,
sim.*, collab.prompt_cooldown_minutes, and hooks.prime_tokens; it cannot
change storage paths or arbitrary config. Agents should propose these changes
through their normal tool/command permission flow. Antigravity hooks force a user
permission prompt before kin config set or kin agent-config set runs.
Automatic snoozes retry notifications without extending an action's freshness
window. A deliberate kin remind snooze defers that window to the snooze expiry;
kin remind exec runs an action deliberately. Older snoozes without provenance
retain their previous deferral semantics, since automatic and manual snoozes
were historically stored identically. This change does not classify or repair
an existing reminder backlog.
Use kin attention estimate --messages 1000 to estimate cost over a fixed prompt window. Conversation accounting is retained when a client provides a stable session id. Hook-driven attention does not fall back to cwd as a fake conversation id, because that would cross-pollute two chats open in the same repo.
Masking Known Secrets
Point Kindex at the env files that hold your secrets, such as ~/.profile, and
it replaces any of their values with the key name before it stores or shows
text: sk-... becomes $OPENAI_API_KEY. This covers every write (add, learn,
edit, supersede, ingestion, MCP tools, hooks, so FTS and embeddings never see
the value) and every output (prime, context, search, show, MCP responses), so
rows written before you turned it on also come out masked.
Kindex reads [export ]NAME=VALUE lines, strips matching quotes and an
unquoted value's trailing #comment, and skips values containing $ or a
backtick and values shorter than min_length. A keys entry matches any name
containing it, ignoring case, and * matches any run of characters, so a full
name selects itself. Without keys, names containing any of KEY, TOKEN,
SECRET, PASSWORD, PASSWD, PASS, PW, CREDENTIAL, AUTH, PRIVATE,
SID, DSN, WEBHOOK, COOKIE, CLIENT_ID, ACCOUNT_ID or API are
selected. Longer values are replaced first; when several names share a value,
the first in file order wins. Files are re-read when they change; a missing or
unreadable file masks nothing and logs one warning.
Stored rows keep their bytes until you clean them:
--apply also cleans node archives. It snapshots each database first, like
automated merges; the snapshot still holds the old values, so delete it once
you have checked the result. Identifiers (primary and foreign keys) are
reported, not rewritten.
Development
License
Business Source License 1.1. Copyright (c) 2026 Wander. Kindex is a Wander project.
You may use Kindex in production, including at work, but not offer it to others as a hosted or managed service. Each version becomes available under the Apache License 2.0 four years after its release. Releases up to and including 0.51.0 were published under the MIT license and remain available under it; LICENSE-MIT keeps that notice for them and for code contributed under it.
Kinbase compatibility
Read signed Kinbase facts and unresolved questions with kin kinbase sync --repo PATH.
Kindex preserves provenance-clamped standing, distinguishes raw evidence from reduced
snapshots, and never writes Kinbase events. See the reader guide.
来源:README.md,提交 4001b07
工具
0版本历史
9- v0.53.0最新Nov 6, 2026
- v0.52.0Nov 3, 2026
- v0.50.0Oct 30, 2026
- v0.49.0Oct 15, 2026
- v0.48.1Oct 6, 2026
- v0.46.0Oct 2, 2026
- v0.45.0Sep 29, 2026
- v0.44.1Sep 23, 2026
- v0.38.0Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。