Reverse engineer anything with agents, from app behavior down to native binaries.
Cognirepo
Local cognitive infrastructure for AI coding agents, semantic memory, repository intelligence, and MCP tools to reduce token usage.
Install: pipx install cognirepo
Install
pipx install cognirepoInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →CogniRepo
mcp-name: io.github.ashlesh-t/cognirepo
Persistent memory and context for any AI tool. Not a chatbot — infrastructure.
lookup_symbol returns file:line very quickly — grep takes 2–8 seconds. On Python repos ≥ 15K LOC, CogniRepo cuts AI coding agent token usage by ~30–78% vs. a targeted grep+read baseline (up to 96–99% vs. reading every matching file naively) — benchmarked on Flask, FastAPI, Celery, and Ansible (5,900+ files). Works with Claude Code, Cursor, and Gemini CLI. Fully offline. No API keys required for indexing or any of the 36 MCP tools.
What it does
Every AI conversation starts from zero. Claude, Cursor, Gemini — none of them remember what you fixed yesterday, which files relate to which features, or what decisions were made last sprint. CogniRepo fixes that.
It sits between your codebase and any AI tool, providing:
- Semantic memory — FAISS vector store with sentence-transformer embeddings. Store decisions, docs, architecture notes. Retrieve them with natural language.
- Episodic log — append-only event journal. Know what happened before that error.
- Knowledge graph — NetworkX DiGraph linking functions, classes, files, imports, inheritance chains, call relationships, and concepts. All queryable.
- AST reverse index — O(1) symbol lookup across your entire codebase in any supported language.
- User behavior profiling — tracks how you prompt so Claude adapts its response style without you having to re-explain preferences every session.
- Error tracking — records errors with prevention hints so Claude avoids repeating the same mistake across sessions.
- Session history — persists conversation exchanges so any session can resume where the last one ended.
- Architectural summaries — auto-generated on first init; built entirely from the local AST index (no API key needed). File → directory → repo summary tree, embedded into FAISS for semantic search.
- Multi-model orchestration — classify query complexity → build context → route to the right model. Claude for deep reasoning, Gemini Flash for quick lookups. All automatic.
Every AI tool that connects gets the same accumulated project knowledge. Memory persists across sessions, across tools, across time.
When to use CogniRepo
Most effective on codebases ≥ 15K LOC. On small repos (< 10K LOC), native file reads are fast enough that the MCP tool schema overhead (~3,700 tokens for 36 tools) takes more than you save. Break-even is roughly 4 tool calls on a medium-sized repo.
CogniRepo vs. claude-context / similar tools:
| Feature | CogniRepo | claude-context / similar |
|---|---|---|
| Pure code retrieval | ✓ (FAISS + graph + AST) | ✓ Often faster on first use |
| Episodic memory (what happened last sprint) | ✓ Persistent BM25 + vector | ✗ |
| Cross-agent handoff (Claude → Gemini → Cursor) | ✓ last_context.json shared |
✗ |
| User behaviour profile (adapts depth/style) | ✓ get_user_profile() |
✗ |
| Error pattern avoidance (learns from past fails) | ✓ record_error() |
✗ |
| Architectural decision records | ✓ record_decision() |
✗ |
| Multi-repo org graph (microservices) | ✓ CHILD_OF / CALLS_API edges |
✗ |
Conclusion: prefer CogniRepo when you value institutional memory across sessions. Use simpler tools when you just need one-shot code retrieval on a small codebase.
Why it helps — measured numbers
Similar plugs
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Open-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key.