This file gives persistent guidance to coding agents working in this repository.
Help evolve this project from a personal MVP into a maintainable Code RAG product without losing the parts that already work.
Primary goals:
- keep the repo usable and honest
- preserve the existing end-to-end indexing/search flow
- improve engineering quality incrementally
- prefer small, verifiable changes over big rewrites
This repository is a local-first Code RAG system with two main parts:
- a FastAPI backend for indexing, search, explain, and agent routes
- a VS Code extension that builds indexes and consumes backend APIs
Current architecture:
api/: FastAPI entrypoints and request handlingai/: LLM/provider integration and agent logicindexer/: zip -> chunk -> ingest pipelineretriever/: hybrid search over Chromaclients/vscode/: VS Code extension UI and API clienteval/: lightweight evaluation scripts
Agents should optimize for the repository's real behavior, not aspirational docs.
- Official indexing support is currently JavaScript/TypeScript only.
- The VS Code extension currently uploads more file types than the backend can truly chunk.
explainhas a newer provider/config path thanagent, and these should be kept aligned over time.- This repo is in MVP shape: core flow exists, but tests, config hygiene, and dependency hygiene are incomplete.
- Prefer targeted improvements over broad rewrites.
- Keep changes easy to review and easy to revert.
- Update docs when behavior changes.
- If code and docs disagree, either fix the mismatch or clearly note it.
- Preserve workspace isolation behavior unless explicitly redesigning it.
- Avoid introducing new infrastructure unless it solves a clear existing pain.
When choosing what to do next, bias toward these:
- Align product claims with actual behavior.
- Improve developer trust in the repo.
- Reduce inconsistency between backend and extension.
- Strengthen the core indexing/search/explain loop before adding new features.
Current top priorities:
- Align allowed extension upload types with backend chunker support.
- Unify LLM configuration flow between
/explainand/agent/explain. - Make search result previews actually useful.
- Clean up dependencies and remove obviously unused or placeholder files.
- Add lightweight smoke tests before deeper feature work.
- Do not claim multi-language support unless chunking and retrieval truly support it.
- Do not commit
.DS_Store, local caches,data/,logs/, or dependency directories. - Do not silently widen scope. This repo benefits from tighter scope, not broader ambition.
- Do not replace working core flows just because they look simple.
- Do not leave placeholder config or empty files without either filling or removing them.
- Keep route behavior explicit and easy to trace.
- Prefer moving logic into helper/services if
api/main.pygets larger. - Keep response shapes stable unless there is a strong reason to change them.
- Any change to upload, file filtering, or chunking must be checked against the VS Code extension behavior.
- Prefer deterministic outputs and stable IDs.
- Do not expand language claims without parser-level support.
- Favor simple, explainable ranking over clever but opaque heuristics.
- If ranking changes, note expected impact in the PR/summary.
- Keep provider resolution consistent across explain and agent paths.
- Prefer evidence-grounded behavior over more autonomous behavior.
- Avoid changes that increase hallucination risk without improving grounding.
- Keep commands and settings consistent with backend behavior.
- If the extension exposes a capability, verify the backend actually supports it.
- Preserve a simple onboarding path for local development.
Choose the lightest checks that meaningfully validate the change.
Useful checks in this repo:
- Python syntax check:
python3 -m compileall api ai indexer retriever eval - Backend health check after startup:
curl http://127.0.0.1:8000/ping - Docker stack:
docker compose up -d --build - VS Code extension build, after installing dependencies in
clients/vscode/:npm run build - Eval script when backend is running:
python3 eval/run_eval.py
If a check cannot be run, say so clearly and explain why.
For most changes, done means:
- the relevant code path is updated
- the change matches actual product behavior
- basic verification was run, or the inability to run it is stated
- related docs/config were updated if needed
- no unrelated local files were committed
Good work in this repo usually includes:
- a concise explanation of what changed
- any important tradeoffs or assumptions
- what was verified
- what remains risky or intentionally deferred
If no higher-priority user direction is given, the safest sequence is:
- repo hygiene and documentation cleanup
- backend/extension behavior alignment
- provider and agent consistency cleanup
- lightweight test and smoke-check coverage
- only then broader feature expansion