How salikawtar/e2-assistant works
E2 Assistant is a Streamlit question-answering tool for a fixed corpus of Canadian environmental-emergency regulations and guidance. Its main workflow routes a question to an exact Schedule 1 table lookup, evidence retrieval, or both; retrieval combines vector and keyword rankings while reserving law and guidance slots. The answer stage generates a cited response, checks citation markers and authority tiers, and returns an answer status. The graph emphasizes this runtime path and documented corpus/index inputs; evaluation and experimental scripts are omitted. Some orchestration details are unsampled, so links not shown by the excerpts or README are omitted.
Main entry points: answer.py Answer pipeline · search_vectors.py Vector search · router.py Question router · search_split.py Law-guidance ranking
Components 21
User interface
- Streamlit page
src/app.py
Question handling
- Answer pipeline
src/answer.py - Question router
src/router.py - Schedule 1 lookup
src/lookup_schedule1.py
Evidence retrieval
- Vector search
src/search_vectors.py - Keyword search
src/search_keyword.py - Law-guidance ranking
src/search_split.py - Hybrid search
src/search_hybrid.py
Answer generation
- Cited generation
src/generate_cited.py - Status and abstention
src/generate_abstain.py - Base generation
src/generate_naive.py - Authority-labelled generation
src/generate_labelled.py
Corpus and index
- Schedule 1 table
data/schedule1.csv - Evidence chunks
data/chunks.jsonl - Vector index
data/vectors/vectors.npy - PDF parsing
src/parsing_pdf.py - HTML parsing
src/parsing_html.py - Document parsing
src/parsing.py - Corpus data
src/corpus.py
Other components
- Questioner
- Gemini model
Connections 22
- Questioner → Streamlit page: asks
README.md - Streamlit page → Answer pipeline: submits question
src/app.py - Answer pipeline → Question router: routes question
README.md - Question router → Schedule 1 lookup: selects lookup
src/router.py - Question router → Law-guidance ranking: selects retrieval
README.md - Schedule 1 lookup → Schedule 1 table: reads rows
src/lookup_schedule1.py - Law-guidance ranking → Vector search: ranks vectors
src/search_split.py - Law-guidance ranking → Keyword search: ranks keywords
src/search_split.py - Hybrid search → Vector search: gets scores
src/search_hybrid.py - Hybrid search → Keyword search: gets scores
src/search_hybrid.py - Vector search → Vector index: scores index
README.md - Vector search → Evidence chunks: checks alignment
src/search_vectors.py - Keyword search → Evidence chunks: indexes text
README.md - Answer pipeline → Cited generation: generates cited answer
README.md - Answer pipeline → Status and abstention: checks status
README.md - Cited generation → Base generation: uses model pool
src/generate_cited.py - Cited generation → Gemini model: generates response
src/generate_cited.py - Status and abstention → Gemini model: generates response
src/generate_abstain.py - Authority-labelled generation → Gemini model: generates response
- Document parsing → PDF parsing: delegates PDF parsing
src/parsing.py - Document parsing → HTML parsing: delegates HTML parsing
src/parsing.py - Corpus data → Evidence chunks: provides corpus