How narukavya/ai-document-intelligence works
The product is a Streamlit document-intelligence app: users upload a PDF or DOCX, which is extracted, cleaned, chunked, embedded, and stored for later question answering; separate actions provide summaries, entities, and key information. The graph also includes the shared parsing and retrieval layers and the Gemini integration. Edges reflect shown calls, imports recorded in the source index, or README documentation; several implementation files were not excerpted, so their internal behavior is not expanded.
Main entry points: streamlit_app.py Streamlit UI · document_loader.py Document Loader · process_document.py Index Document · summary_service.py Summary Service
Components 20
User Interface
- Streamlit UI
app/frontend/streamlit_app.py
Document Processing
- Index Document
app/backend/process_document.py - Document Loader
app/processing/document_loader.py - PDF Loader
app/processing/pdf_loader.py - DOCX Loader
app/processing/docx_loader.py - Text Cleaner
app/processing/text_cleaner.py - Text Chunker
app/rag/chunker.py
Document Intelligence
- Summary Service
app/backend/summary_service.py - Summarizer
app/summarizer/summarizer.py - Entity Service
app/backend/entity_service.py - Entity Extractor
app/extraction/entity_extractor.py - Information Service
app/backend/information_service.py - Information Extractor
app/extraction/information_extractor.py
Retrieval and Generation
- Vector Store
app/rag/vector_store.py - Embedding Model
app/rag/embeddings.py - Question Answering
app/rag/qa_chain.py - Retriever
app/rag/retriever.py - Gemini Client
app/rag/gemini_client.py
Other components
- User
- Google Gemini
Connections 29
- User → Streamlit UI: uploads and asks
app/frontend/streamlit_app.py - Streamlit UI → Index Document: indexes upload
app/frontend/streamlit_app.py - Streamlit UI → Summary Service: requests summary
app/frontend/streamlit_app.py - Streamlit UI → Entity Service: requests entities
app/frontend/streamlit_app.py - Streamlit UI → Information Service: requests information
app/frontend/streamlit_app.py - Streamlit UI → Question Answering: asks question
app/frontend/streamlit_app.py - Index Document → Document Loader: loads document
app/backend/process_document.py - Index Document → Text Cleaner: cleans text
app/backend/process_document.py - Index Document → Text Chunker: chunks text
app/backend/process_document.py - Index Document → Vector Store: stores chunks
app/backend/process_document.py - Document Loader → PDF Loader: dispatches PDF
app/processing/document_loader.py - Document Loader → DOCX Loader: dispatches DOCX
app/processing/document_loader.py - Summary Service → Document Loader: loads document
app/backend/summary_service.py - Summary Service → Text Cleaner: cleans text
app/backend/summary_service.py - Summary Service → Summarizer: generates summary
app/backend/summary_service.py - Entity Service → Document Loader: loads document
app/backend/entity_service.py - Entity Service → Text Cleaner: cleans text
app/backend/entity_service.py - Entity Service → Entity Extractor: extracts entities
app/backend/entity_service.py - Information Service → Document Loader: loads document
app/backend/information_service.py - Information Service → Text Cleaner: cleans text
app/backend/information_service.py - Information Service → Information Extractor: extracts information
app/backend/information_service.py - Information Extractor → Gemini Client: generates prompt
app/extraction/information_extractor.py - Summarizer → Gemini Client: generates summary
app/summarizer/summarizer.py - Vector Store → Embedding Model: embeds chunks
app/rag/vector_store.py - Question Answering → Retriever: retrieves context
app/rag/qa_chain.py - Question Answering → Gemini Client: generates answer
app/rag/qa_chain.py - Retriever → Vector Store: queries vectors
app/rag/retriever.py - Retriever → Embedding Model: embeds query
app/rag/retriever.py - Gemini Client → Google Gemini: calls model
app/rag/gemini_client.py