Skip to content

docs(architecture): explain RAG design decisions#1

Merged
fanza-ks merged 1 commit intomainfrom
docs/rag-design-decisions
Apr 16, 2026
Merged

docs(architecture): explain RAG design decisions#1
fanza-ks merged 1 commit intomainfrom
docs/rag-design-decisions

Conversation

@fanza-ks
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a Design decisions section to docs/architecture.md explaining why the RAG pipeline is shaped the way it is, prompted by an external question asking how the architecture was arrived at (and why it differs from generic notes-RAGs like gbrain).
  • Covers: per-declaration chunking, Herald-style informalization before embedding, dependency-aware topological ordering, HyDE on the query side, dual Postgres + Chroma store, and model/task-type tiering.
  • Ends with a small comparison table contrasting this pipeline against a generic notes-RAG.

Test plan

  • Render docs/architecture.md (VS Code preview or on GitHub) and verify heading hierarchy, code-block formatting, and the comparison table.
  • Confirm relative links (../database/vector_db.py, etc.) resolve on the GitHub view.
  • Cross-check the cited claims against the code:
    • database/vector_db.py:43 — hybrid embedding-input string
    • database/informalize.py — ±2 neighbours + dependency context
    • database/embedding.pyRETRIEVAL_DOCUMENT vs RETRIEVAL_QUERY

🤖 Generated with Claude Code

…neric RAGs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fanza-ks
Copy link
Copy Markdown
Collaborator Author

Following up on a question by Shlok Vaibhav on Zulip, I've added a more detailed explanation of what we do and why we made certain design choices for the RAG system in physlibsearch

@fanza-ks fanza-ks merged commit 05ea001 into main Apr 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant