How kalyrifer/decision-history-rag works
Decision History RAG turns GitHub repository history into searchable evidence for questions about engineering decisions. Its main workflow is Git/GitHub ingestion → normalization into entities and links → text chunks and embeddings → hybrid retrieval and graph expansion → LLM synthesis with reasons, sources, and a timeline, presented through the UI or CLI. The README documents additional file-path search, query rewriting, date relevance, and repository-specific signals. Some modules were not sampled, so their documented capabilities appear here without speculative internal call links.
Main entry points: pipeline.py Retrieval pipeline · answer.py Answer assembly · storage.py Raw JSONL · app.py Streamlit interface
Components 24
History ingestion
- Raw JSONL
ingest/storage.py - Git history loader
ingest/git_source.py - Issues and PR loader
ingest/github_source.py
Knowledge preparation
- Entity normalizer
normalize/parse_raw.py - Relation extractor
normalize/extract_relations.py - Repository signals
domain/pydantic.py - Text chunks
represent/to_text.py - Embedding builder
represent/embed.py
Evidence retrieval
- Retrieval pipeline
retrieve/pipeline.py - Query rewriting
retrieve/query_rewrite.py - Dense and FTS search
retrieve/hybrid.py - File-path search
retrieve/file_search.py - Graph expansion
retrieve/expand.py - Date relevance
retrieve/date_relevance.py
Answer delivery
- Streamlit interface
ui/app.py - Command-line interface
cli.py - Answer assembly
synthesize/answer.py - Aspect detection
synthesize/focus.py - Prompt construction
synthesize/prompt.py - Model rotation
synthesize/llm.py
Other components
- Questioner
- GitHub
- Postgres and pgvector
- OpenRouter
Connections 31
- GitHub → Git history loader: provides Git history
- GitHub → Issues and PR loader: provides issues and PRs
- Git history loader → Raw JSONL: writes records
- Issues and PR loader → Raw JSONL: writes records
- Raw JSONL → Entity normalizer: supplies raw records
- Entity normalizer → Postgres and pgvector: writes entities
- Relation extractor → Postgres and pgvector: writes relations
- Postgres and pgvector → Text chunks: supplies entity text
- Text chunks → Postgres and pgvector: writes chunks
- Postgres and pgvector → Embedding builder: supplies chunks
- Embedding builder → Postgres and pgvector: writes vectors
- Questioner → Streamlit interface: asks question
- Questioner → Command-line interface: asks question
- Streamlit interface → Retrieval pipeline: requests search
- Command-line interface → Retrieval pipeline: requests search
- Retrieval pipeline → Query rewriting: rewrites query
- Query rewriting → Repository signals: adds domain signals
- Retrieval pipeline → Dense and FTS search: runs dense and FTS
- Dense and FTS search → Postgres and pgvector: searches chunks
- Retrieval pipeline → File-path search: searches file paths
- File-path search → Postgres and pgvector: reads files and relations
- Retrieval pipeline → Graph expansion: expands anchors
- Graph expansion → Postgres and pgvector: reads relations
- Retrieval pipeline → Date relevance: adjusts result relevance
- Retrieval pipeline → Answer assembly: passes evidence
- Answer assembly → Aspect detection: detects aspects
- Answer assembly → Prompt construction: builds synthesis prompt
- Answer assembly → Model rotation: requests generation
- Model rotation → OpenRouter: calls model API
- Answer assembly → Streamlit interface: returns answer and sources
- Answer assembly → Command-line interface: returns answer and sources