How mattkari/source-grounded-rag works
This is a source-grounded scholarly research assistant with a second, substantial workflow for drafting reviewable articles. Researchers ask questions through a web or CLI surface; a shared retrieval-and-generation pipeline returns answers with traceable citations or refuses when evidence is insufficient. Documents can also be ingested or uploaded with layout measurement and review. The article workflow explores sources, drafts and checks sections, then assembles and exports an article. The README documents the product capabilities; some internals are unsampled, so the graph omits uncertain links.
Main entry points: ask.py Query pipeline · pipeline.py Article pipeline · app.py Article workspace · upload.py Upload workflow
Components 24
Research interfaces
- Web chat
app.py - Interactive CLI
main.py - Single-query CLI
ask.py - Upload review UI
app.py - Article workspace
app.py
Corpus management
- Upload workflow
upload.py - PDF layout profile
layout.py - Document identity
identity.py - Extract and chunk
ingest.py - Canonical pages
data/canonical/pages.jsonl - Passage index
index
Grounded Q&A
- Query pipeline
ask.py - Embedding provider
embeddings.py - Document profiles
documents.py - Model services
Article workflow
- Source exploration
article/explorer.py - Article source filter
article/sources.py - Article pipeline
article/pipeline.py - Article checks
article/checks.py - Article assembly
article/assemble.py - Article export
article/export.py
Review and records
- Workflow trace
article/trace.py - Run history
runs.py
Other components
- Researcher
Connections 29
- Researcher → Web chat: asks through
README.md - Researcher → Interactive CLI: asks through
README.md - Researcher → Single-query CLI: asks through
README.md - Researcher → Upload review UI: submits document
README.md - Web chat → Query pipeline: calls shared pipeline
README.md - Interactive CLI → Query pipeline: calls shared pipeline
README.md - Single-query CLI → Query pipeline: runs query
README.md - Upload review UI → Upload workflow: uses workflow
app.py - Upload workflow → PDF layout profile: measures PDF
upload.py - Upload workflow → Document identity: proposes identity
upload.py - Upload workflow → Extract and chunk: extracts and chunks
upload.py - Extract and chunk → Canonical pages: writes pages
README.md - Extract and chunk → Embedding provider: embeds passages
ingest.py - Extract and chunk → Passage index: builds index
README.md - Query pipeline → Embedding provider: embeds question
ask.py - Query pipeline → Passage index: retrieves passages
README.md - Query pipeline → Document profiles: uses document profiles
ask.py - Query pipeline → Model services: requests grounded answer
README.md - Query pipeline → Run history: records query
app.py - Researcher → Article workspace: drafts article
README.md - Article workspace → Source exploration: starts exploration
app.py - Source exploration → Query pipeline: queries evidence
article/explorer.py - Article workspace → Article pipeline: runs article workflow
app.py - Article pipeline → Article source filter: filters sources
article/pipeline.py - Article pipeline → Query pipeline: drafts sections
article/pipeline.py - Article pipeline → Article checks: checks outcomes
article/pipeline.py - Article pipeline → Article assembly: assembles validated draft
article/pipeline.py - Article pipeline → Article export: saves or exports
article/pipeline.py - Article workspace → Workflow trace: shows workflow trace
app.py