knowledge-ingest
Ingest or update a codebase in the agent-knowledge base. First run bootstraps the knowledge base from scratch; subsequent runs are incremental (only changed/new/deleted files reprocessed). Uses tree-sitter for zero-token structural extraction. Trigger on "/knowledge-ingest", "ingest this codebase", "load this into knowledge", "scan this project", "index this repo", "update knowledge", "refresh knowledge", "re-ingest". --- # knowledge-ingest Populate or update agent-knowledge from a codebase. Tree-sitter extracts structure (zero LLM tokens), then the agent distills clusters into knowledge entries + graph edges via existing MCP tools. **First run**: full ingest — scans all files, creates entries from scratch. **Subsequent runs**: incremental — only reprocesses files whose SHA256 changed, adds entries for new files, removes entries for deleted files. The `.knowledge-ingest-cache.json` file in the target directory tracks state between runs. ## When to use - **Onboarding a new project** — bootstrap the knowledge base so future sessions have context - **After a refactor** — re-run to update subsystem boundaries and relationships - **Periodic refresh** — re-run after significant changes to keep knowledge current - **Importing documentation** — PDFs, architecture diagrams, or external URLs ## When NOT to use - Single-file changes — just write a knowledge entry manually - No code changes since last ingest — the cache will skip everything anyway (fast no-op) ## Procedure ### Phase 0 — Validation 1. Confirm the target path exists and is a directory. 2. Detect project name: - Check `package.json` → `name` field - Check `Cargo.toml` → `[package] name` - Check `go.mod` → `module` line - Check `pyproject.toml` → `[project] name` - Fall back to directory basename 3. Check for `.knowledge-ingest-cache.json` in the target directory. If found, load it — this is an incremental run. Report how many files changed since last ingest. ### Phase 1 — Structural Extraction (zero tokens) 4. Loc
Changelog: Source: GitHub https://github.com/keshrath/agent-knowledge
Loading comments...