A local, single-user RAG study assistant over course materials (slides, papers, notes). It answers questions with synthesis from Claude, grounded in retrieved sources, with citations back to the exact source slide/page. Ingestion and retrieval run entirely on-machine; only generation calls the Anthropic API.
- Read
docs/architecture.md, it is the full design. - Read ADRs under
docs/decisions/, locked decisions live there. - Read the GitHub issues, work is tracked as phases there.
- Read
README.md, Status blurb states intent. - Compare against repo, which is the ground truth.
- Scan with
lsand compare with directory structure inarchitecture.mdto gauge progress. - Use
git logto reveal further current progress whether in between phases or mid-phase.
- Scan with
- Fetch the current issue being worked on from the GitHub repo, read its full content.
- Also read the full content of the current issue's sub issues (if any).
Canonical context lives in AGENTS.md files (tool-neutral). Each CLAUDE.md is a one-line
@AGENTS.md import stub so Claude Code's directory-walk loading picks up the same content. Edit
AGENTS.md, never the stub. Each package/service carries its own scoped AGENTS.md describing its
surface; agents read the nearest file in the tree, so the closest one wins. This file is the root
entry point — keep package-specific detail in the package's own AGENTS.md.
- Python 3.12 on a
uvworkspace. Runuv synconce to resolve and install every workspace member (root +packages/*) into a single.venv. - Run tools through the workspace venv with
uv run <cmd>(e.g.uv run pytest); do not call a globalpython/pip. - Add a runtime dependency by editing the owning package's
pyproject.tomldependencies, thenuv sync. Add a dev/test-only tool to the root[dependency-groups] devinstead. - Bring up the store with
docker compose up -d(PostgreSQL + pgvector). Copy.env.exampleto.envfirst — the connection string and secrets live there. The DB is required for the store layer and its tests. - New workspace members go under
packages/(libraries) or top-level (cli/,services/,apps/web/) perdocs/architecture.md; each gets its own scopedAGENTS.mdplus a one-lineCLAUDE.mdstub (@AGENTS.md). - Install hooks once with
pre-commit install;pre-commit run --all-filesruns lint + format + typecheck across the tree.
- The CI plan is in
.github/workflows/ci.yaml: achecksjob (ruff lint, ruff format check, mypy, pytest against a pgvector service) and adocsjob that builds the Sphinx site (uv run sphinx-build -b html docs site -W, build-only — deployment lives indocs-deploy.yaml). - Run the whole suite with
uv run pytest. Integration tests need the database — rundocker compose up -dfirst or they fail to connect. - Integration tests are marked
@pytest.mark.integration. Scope a run withuv run pytest -m "not integration"(fast, no DB) or-m integration(DB-backed); target one test withuv run pytest -k "<name>". - Lint, format, and typecheck must also be green:
uv run ruff check . && uv run ruff format --check . && uv run mypy. Fix every error and type failure until the whole suite is green before you merge. - Docs must build clean:
uv run sphinx-build -b html docs site -W(CI runs this too —-Wturns Sphinx warnings into errors, catching broken toctrees, anchors, and autodoc import failures). - Add or update tests for the code you change, even if nobody asked.
- Schema changes need a fresh DB:
initialize_schema()isCREATE ... IF NOT EXISTSand will not retrofit constraints, so rundocker compose down -v && docker compose up -dafter editingstore/schema.py.
ruffformats and lints (line length 100, rule setE,F,I,UP,B);mypyruns instrictmode. Both must pass — do not silence them without cause.- Type every function signature;
mypy --strictrejects untyped defs. Prefer explicit, narrow types overAny.
The locked architectural decisions are recorded as ADRs, indexed in
docs/decisions/. They are binding and the source of truth — read the relevant
ADR before changing what it governs, and do not restate its rules here.
- Branch from
dev, naming the branch with its GitHub issue number first (e.g.4-embeddingsfor issue #4) so the branch links back to its issue. - PR title format:
[<phase or package>] <Title>— e.g.[rag_core/store] Add schema + CRUD. - Run the full gate green before handing off (with
docker compose up -d):uv run ruff check . && uv run ruff format --check . && uv run mypy && uv run pytest && uv run sphinx-build -b html docs site -W. - Update the
README.mdStatus blurb in the same change — current status lives there (and in the GitHub issues), not in this file. - Never commit; only stage. Do not run
git commit. At the end of a set of changes,git addthe relevant files and leave them staged for the human to review — but only if 0 files are currently staged. If anything is already staged, do not stage at all; leave the working tree as-is.