How sts87/mini-rag works
Enterprise Knowledge AI is a Streamlit RAG assistant: employees ask questions, the app retrieves relevant chunks from a persistent FAISS index, generates a grounded answer with citations, and logs the interaction. A separate indexing command loads and tags PDFs, splits them into chunks, embeds them, and saves the index. The README also describes OCI deployment, but deployment wiring is omitted because the available source excerpts do not show its runtime relationships.
Main entry points: streamlit_app.py Streamlit interface · indexer.py Embedding indexer · build_index.py Index builder · retriever.py Semantic retriever
Components 15
Document indexing
- Corporate PDFs
data/documents - Index builder
src/scripts/build_index.py - PDF loader
src/app/loader.py - Document chunker
src/app/chunker.py - Embedding indexer
src/app/indexer.py - FAISS vector store
src/app/indexer.py
Question answering
- Semantic retriever
src/app/retriever.py - FAISS search
src/app/retriever.py - Answer generator
src/app/generator.py
User interaction
- Streamlit interface
src/streamlit_app.py - Answer and citations
src/app/generator.py
Interaction logging
- Interaction logger
src/app/logger.py - JSONL interaction log
Other components
- Employee
- Cohere API
Connections 20
- Employee → Streamlit interface: asks question
- Corporate PDFs → PDF loader: loads pages
- Index builder → PDF loader: calls
- Index builder → Document chunker: calls
- Index builder → Embedding indexer: calls
- PDF loader → Document chunker: passes documents
- Document chunker → Embedding indexer: passes chunks
- Embedding indexer → Cohere API: requests embeddings
- Embedding indexer → FAISS vector store: writes index and chunks
- Streamlit interface → Embedding indexer: loads index
- Streamlit interface → Semantic retriever: requests retrieval
- Semantic retriever → Cohere API: embeds query
- Semantic retriever → FAISS search: searches vectors
- FAISS search → FAISS vector store: searches loaded index
- Streamlit interface → Answer generator: requests answer
- Answer generator → Cohere API: requests chat completion
- Answer generator → Answer and citations: formats answer and sources
- Answer and citations → Streamlit interface: displays
- Streamlit interface → Interaction logger: records interaction
- Interaction logger → JSONL interaction log: appends record