kindex
AGENTS.md33 starsChanged 57 days agoMITView on GitHub
Kindex is a persistent knowledge graph that indexes conversations, projects, and intellectual work so that Codex never starts a session blind. The CLI is kin. Install Python test dependencies (pip install -e ".[dev,mcp]") and Node.js 24 or newer. Node executes the modern Claude adapter contract tests; it is not a Kindex package dependency. The CI workflow runs full pytest with Python 3.12, Node.js 24, and .[dev,mcp] on pull requests and pushes to main. It also supports manual dispatch and reusable…
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- kindex-captureSkill
- kindex-learnSkill
- kindex-primeSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
20 rules. About 0 are common, 4 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
When working in this codebase, follow these practices:
- Very specific: line 69
Capture new knowledge: When you learn something significant, use kin add "<insight>" --tags <domain1>,<domain2> to persist it with tags.
- Very specific: line 70
Create links: When you discover a relationship between concepts, use kin link <a> <b> <relationship> --why "<reason>" to connect them.
- Very specific: line 71
Track decisions: Use kin add "<decision>" --type decision --tags <project> for architectural or design decisions.
- Very specific: line 72
Record constraints: Use kin add "<rule>" --type constraint --trigger <event> --action <verify|warn|block> for invariants.
- Very specific: line 73
Flag attention items: Use kin add "<item>" --type watch --owner <person> --expires <date> for things that need monitoring.
- Very specific: line 74
Search before adding: Use kin search <term> or kin search <term> --tags <domain> to check if knowledge already exists before duplicating.
- Very specific: line 76
Edit, don't re-add: Use kin edit <id-or-title> --content "..." to correct an existing node instead of creating a near duplicate.
- Very specific: line 77
Coordinate multi-agent work: Use kin coord join <name> to become a member (unread tracking), kin coord attach <name> <node> for shared …
- Very specific: line 78
Profiles: When profiles: are configured in ~/.config/kindex/kin.yaml, the active graph resolves by --profile flag > KIN_PROFILE env > .kin …
- Very specific: line 79
Filter by tags: Use kin list --tags <tag1>,<tag2> to find nodes by tag (AND logic).
- Very specific: line 80
Check status: Use kin status to see graph health and active operational nodes.
- Very specific: line 81
Session tags: Use kin tag start <name> --focus "what you're working on" to create a named session handle.
- Distinctive: line 96
When asked to release, follow these steps exactly.
- Very specific: line 98
Run full test suite: pytest tests/ -v
- Distinctive: line 100
Commit version bump and all changes
- Very specific: line 103
Create GitHub release: gh release create vX.Y.Z --title "..." --notes "..."
- Very specific: line 105
Verify on PyPI: pip index versions kindex 2>/dev/null | head -1 or check https://pypi.org/project/kindex/
- Very specific: line 114
Verify the MCP listing metadata is current: server.json version/package fields match the release, and https://mcpmarket.com/server/kindex …
- Distinctive: line 121
Search: Hybrid retrieval combining FTS5 BM25 scores, graph BFS traversal, and optional vector similarity, merged via Reciprocal Rank Fusion …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kindex — Knowledge Graph for AI-Assisted Workflows
Kindex is a persistent knowledge graph that indexes conversations, projects, and intellectual work so that Codex never starts a session blind. The CLI is kin.
Running Tests
Install Python test dependencies (pip install -e ".[dev,mcp]") and Node.js 24 or newer.
Node executes the modern Claude adapter contract tests; it is not a Kindex package dependency.
# All tests
pytest tests/ -v
# Specific module
pytest tests/test_cli.py -v
pytest tests/test_hooks.py -v
pytest tests/test_store.py -v
# With coverage
pytest tests/ --cov=kindex --cov-report=term-missingThe CI workflow runs full pytest with Python 3.12, Node.js 24, and .[dev,mcp] on pull
requests and pushes to main. It also supports manual dispatch and reusable
workflow calls. Publish to PyPI runs only on v* tag pushes and invokes CI
before building and publishing. The test check must be required in branch
protection to prevent merging a failing suite.
Key File Locations
| Path | Purpose |
src/kindex/cli.py | CLI entry point and all kin subcommands |
src/kindex/dream.py | Dream cycle: fuzzy dedup, suggestion auto-apply, domain edges |
src/kindex/referent.py | R0 referent binding: digest validation, staleness sweep, rebind |
src/kindex/snapshots.py | Pre-merge SQLite snapshots (rotating, fail-closed) to XDG state dir |
src/kindex/dream_deep.py | LLM-powered cluster consolidation (--deep mode only) |
src/kindex/store.py | SQLite + FTS5 storage layer |
src/kindex/config.py | Configuration loading and Config model |
src/kindex/graph.py | Graph analytics (centrality, communities, bridges) |
src/kindex/retrieve.py | Hybrid search (FTS5 + graph BFS + RRF merge) |
src/kindex/extract.py | Knowledge extraction from text and sessions |
src/kindex/ingest.py | Project and session ingestion pipeline |
src/kindex/sessions.py | Session tag lifecycle (start, update, segment, resume) |
src/kindex/coordination.py | Collab conversations (members, cursors, inject messages, resources) |
src/kindex/locks.py | Advisory node locks (acquire, release, expiry sweep) |
src/kindex/hooks.py | Claude Code hook handlers (prime, compact) |
src/kindex/setup.py | System setup (Codex hooks, launchd, crontab, .kin git merge driver) |
src/kindex/kin_merge.py | Structured 3-way union merge for .kin/index.json + .kin/code-map.json (kin merge-kin git driver) |
src/kindex/daemon.py | Background daemon and cron cycle |
src/kindex/budget.py | LLM spend tracking and budget enforcement |
src/kindex/vectors.py | Vector embedding, contextual chunk indexing, reindex maintenance, and similarity search |
src/kindex/vault.py | Markdown vault import/export |
src/kindex/models.py | Core data models |
src/kindex/schema.py | Database schema and migrations |
src/kindex/llm.py | LLM provider abstraction |
tests/ | All tests (pytest) |
~/.kindex/ | Default data directory (SQLite DB, logs) |
~/.config/kindex/kin.yaml | User config |
.kin/config | Git-tracked project context and optional work policy |
.kin/index.json | Git-tracked project graph snapshot generated by kin index |
.kin/code-map.json | Git-tracked repo code map generated by kin export code-map |
.gitattributes | Points .kin/index.json + .kin/code-map.json at the merge=kindex driver (auto-written by kin index) |
Session Directives
When working in this codebase, follow these practices:
- Capture new knowledge: When you learn something significant, use
kin add "<insight>" --tags <domain1>,<domain2>to persist it with tags. - Create links: When you discover a relationship between concepts, use
kin link <a> <b> <relationship> --why "<reason>"to connect them. - Track decisions: Use
kin add "<decision>" --type decision --tags <project>for architectural or design decisions. - Record constraints: Use
kin add "<rule>" --type constraint --trigger <event> --action <verify|warn|block>for invariants. - Flag attention items: Use
kin add "<item>" --type watch --owner <person> --expires <date>for things that need monitoring. - Search before adding: Use
kin search <term>orkin search <term> --tags <domain>to check if knowledge already exists before duplicating. - Bind claims about code:
kin add "<claim>" --referent <path>hashes the referent sokin stalecan later demote claims whose referent moved (re-verify withkin stale --rebind <id>). - Edit, don't re-add: Use
kin edit <id-or-title> --content "..."to correct an existing node instead of creating a near duplicate. Additive types (decision, constraint, directive, checkpoint, watch) only accept--appendand--expires; usekin supersede <id> "<new text>" --reason "..."to replace them with history.kin changelogshows per-field diffs. - Coordinate multi-agent work: Use
kin coord join <name>to become a member (unread tracking),kin coord attach <name> <node>for shared resources,kin coord inject <name> set "<msg>" [--to <agent>]for standing messages, andkin lock <id> --ttl <min> --note "<why>"/kin unlock <id>for advisory locks before editing contested nodes. - Profiles: When
profiles:are configured in~/.config/kindex/kin.yaml, the active graph resolves by--profileflag >KIN_PROFILEenv >.kinchainprofile:key > cwd roots match >default_profile.kin profile whichshows the resolution;kin whoamishows the agent identity used for locks/claims/collabs. - Filter by tags: Use
kin list --tags <tag1>,<tag2>to find nodes by tag (AND logic). Tags supplement auto-categorization. - Check status: Use
kin statusto see graph health and active operational nodes. - Session tags: Use
kin tag start <name> --focus "what you're working on"to create a named session handle. Update withkin tag update <name> --focus "..."orkin tag segment <name> --focus "new topic" --summary "what happened". Resume in a new session withkin tag resume <name>. End withkin tag end <name> --summary "...". Seekin tag listfor all tags. - Project policy:
.kin/configships with the repo. Runkin policy check --event agent-startbefore meaningful code work when shell access is available. Linear is opt-in only; enforce it only whenwork_policy.linear.enabledis true in the project config.
Auto-Context Loading
At the start of each session, load relevant context:
kin prime --for hookThis auto-detects the current project from $PWD and outputs a context block with relevant knowledge, active constraints, and recent changes.
Release Checklist
When asked to release, follow these steps exactly. Do NOT install twine or attempt manual PyPI upload — it's fully automated.
- Run full test suite:
pytest tests/ -v - Bump
versioninpyproject.tomland add a## [X.Y.Z] - YYYY-MM-DDentry toCHANGELOG.md. The pre-commit hook (scripts/sync-version.sh) syncssrc/kindex/__init__.py, the README badge,docs/index.html,server.json,docs/.well-known/mcp/server-card.jsonand both plugin manifests from it;tests/test_release_metadata.pyfails CI if any surface disagrees. Ifgit config core.hooksPathis set globally (it is on Jeremy's machine), the repo hook never runs: runbash scripts/sync-version.shby hand before committing, and runpytest tests/test_release_metadata.pybefore tagging - Commit version bump and all changes
- Push to main:
git push origin main - Tag:
git tag vX.Y.Z && git push origin vX.Y.Z - Create GitHub release:
gh release create vX.Y.Z --title "..." --notes "..." - Watch the workflow:
gh run watch <id> -R wandercom/kindex-- every job (test, build, publish, mcp-registry) must pass - Verify on PyPI:
pip index versions kindex 2>/dev/null | head -1or check https://pypi.org/project/kindex/ The release publishes the server entry to the MCP Registry after PyPI succeeds (
.github/workflows/publish-mcp.yml, OIDC, no token; it refuses to publish a version PyPI does not have, andgh workflow run publish-mcp.yml -f tag=vX.Y.Z -R wandercom/kindexbackfills a release tagged before this existed). The workflow confirms the registry itself, but to check by hand -- note thatsearchmatches substrings across every server and every historical version, soio.github.jmcentire/kindexand old releases come back too; match the exact name and the registry'sisLatestflag rather than a position in the list:curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.wandercom/kindex&version=latest" \ | python3 -c "import json,sys; n='io.github.wandercom/kindex'; e=[x['server'] for x in json.load(sys.stdin)['servers'] if x['server']['name']==n and x['_meta']['io.modelcontextprotocol.registry/official']['isLatest']]; print(e[0]['version'] if e else 'MISSING')"The registry is how MCP clients discover the server.
- Verify the MCP listing metadata is current:
server.jsonversion/package fields match the release, and https://mcpmarket.com/server/kindex reflects the published package after indexing.
Definition of done: The release is complete when (a) all workflow jobs are green, (b) the new version appears on PyPI, (c) pip install kindex==X.Y.Z succeeds, and (d) MCP/server metadata has been updated or a marketplace refresh has been requested. If any job fails, fix the issue, bump to a new patch version, and repeat from step 1 -- do not re-tag or force-push an existing tag.
Architecture Notes
- Storage: SQLite with FTS5 full-text search, triggers for index sync
- Search: Hybrid retrieval combining FTS5 BM25 scores, graph BFS traversal, and optional vector similarity, merged via Reciprocal Rank Fusion (RRF)
- Embeddings: Voyage defaults to
voyage-context-4; contextual chunking activates only for provider/model support. Usekin embed plan/enqueue/drain/reindex/statusfor scoped or gradual reindexing. - Context tiers: full (~4000 tokens), abridged (~1500), summarized (~750), executive (~200), index (~100) -- auto-selected by budget
- Node types: concept, document, session, person, project, decision, question, artifact, skill, constraint, directive, checkpoint, watch
- Edge types: relates_to, depends_on, derived_from, contradicts, etc. with weights and provenance
- Node mutability classes (enforced by
kin edit/ MCPedit, overridable via configedit_policy):
| Class | Node types | Allowed edits |
| editable | concept, document, artifact, skill, person, project, question | Full in-place: title, content, append, tags, intent, expires |
| additive | decision, constraint, directive, checkpoint, watch | append + expires only; replace via kin supersede |
| managed | task, session, coordination | Refused — use kin task / kin tag / kin coord |
- Audience: private / team / public scoping with export boundary enforcement
- Weight decay: Nodes and edges naturally fade unless accessed, keeping the graph fresh
- Generated
.kinartifacts (.kin/index.json,.kin/code-map.json): never hand-resolve a git conflict in them.kin indexauto-registers thekin merge-kinstructured union merge driver (via.gitattributes+ local.git/config);kin setup-merge(re)installs it per clone. Regenerate withkin index/kin export code-maprather than hand-editing the JSON.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

