A local second brain across code and AI agent conversations.

CodeGps indexes your code structure and the conversations you have with AI coding agents (Cursor, Claude Code, Codex, Copilot) into one local knowledge graph. An agent pipeline triages noise, extracts decisions and business rules, models the business domain, and aggregates what you know into a cross-project skill graph — split along two axes: technical and industry.

L5 Skill graph ── technical + industry skills across projects L4 Cross-project links ── concepts shared between repos L3 Concepts ── clustered facts, agent-named L2.5 Domain enrichment ── entities, relationships, skills, industry, gaps L2 Facts ── decisions, business rules, intents L1.5 Triage ── relevance / domain / quality / linkage L1 Conversations ── sessions, turns, tool calls L0 Code structure ── symbols, calls, imports, fields

Syntax is deterministic.

File paths, code blocks, shell commands, stack traces — pure parsers. Tree-sitter for code, regex DDL for SQL.

Meaning is agent-driven.

Triage, extraction, clustering, linking, verification — each is a named agent with a versioned prompt and JSON schema, cached in agent_runs.

Grounded, never assumed.

Every node carries a grounding tier — structural, stated, corroborated, external, model — so project truth and inferred knowledge stay separable and filterable.

Technical and industry scopes.

One axis is what the architecture objectively says; the other is the business domain your projects serve. Skills aggregate across both into a second-brain profile.

Local-first, SQLite throughout.

Three databases: code.db, knowledge.db, and a global ~/.codegps/global.db. Ollama is the default backend; any OpenAI-compatible endpoint works.

MCP-native.

20 tools over stdio. Drop into any MCP-aware agent in a single config block.

Cross-project memory.

Concepts you decided in project A surface when you start project B. Mechanical match plus a Linker Agent for semantic similarity.

Quickstart

# 1. Install (Node 20+)
git clone https://github.com/tienan92it/CodeGps && cd CodeGps
npm install && npm run build && npm link

# 2. Local LLM (one-time)
ollama pull qwen3:4b-instruct
ollama pull qwen2.5:14b
ollama pull qwen3-embedding:0.6b

# 3. Index a project
cd /path/to/your/project
codegps init
codegps sync
codegps ingest
codegps link        # cross-project links + skill graph
codegps profile     # industries + top skills

Full walkthrough: getting started →

Why CodeGps exists

Pre-indexed code graphs (e.g. codegraph) make agents cheaper and faster. But they only know what the AST says, never what you and the agent decided together — the rationale, the constraints, the trade-offs that never made it into a comment.

CodeGps adds the layers on top: raw conversation, triage, facts, domain enrichment, concepts, cross-project links, and a global skill graph. Each layer is auditable, each agent's run is cached, and every semantic call is a model + prompt + schema you can swap.