How anilkumark-10/document-ai-assistant works
Project type and purpose
• From the file tree and README (“Document-Assistant”), this is a full-stack Python application whose goal is to ingest PDF documents, preprocess them, build a vector store of embeddings, and expose QA & summarization capabilities via a Streamlit frontend.
File structure
• Top-level directories:
• app/backend – Implements core NLP/ML pipelines (pdf_loader, preprocessor, embeddings, vector_store, llm wrappers, qa, summarizer).
• app/frontend – Streamlit app (streamlit_app.py) with its own requirements.
• Key config files: requirements.txt (root & frontend), .gitignore.
• No explicit external deployment scripts, so assume a single process or container running both front and back ends.
README for additional insights
• README is minimal, but file names reveal:
• PDF ingestion (pdf_loader.py)
• Text preprocessing (preprocessor.py)
• Embedding generation (embeddings.py)
• Vector database operations (vector_store.py)
• LLM interactions (llm.py)
• Downstream QA & summarization modules (qa.py, summarizer.py)
• Streamlit UI (streamlit_app.py)
a. Components
• Frontend: Streamlit-based web UI
• Backend services:
1. PDF Loader
2. Preprocessor
3. Embeddings module
4. Vector Store (e.g., FAISS or Pinecone)
5. LLM wrapper (calls an API like OpenAI)
6. QA service
7. Summarization service
• Data storage: vector database
• External services: LLM API
b. Relationships & interactions
1. User uploads or selects a PDF via Streamlit → frontend sends document to Backend → PDF Loader
2. PDF Loader → Preprocessor → Embeddings → Vector Store (persistence)
3. User submits a query in UI → QA module retrieves relevant embeddings from Vector Store → LLM is invoked → answer returned to frontend
4. Summarizer: similar flow (retrieve context → LLM summarize → frontend)
c. Architectural patterns & design principles
• Layered architecture: UI layer, service layer (QA/Summarizer), data layer (vector store), external API layer (LLM).
• Pipeline pattern for document ingestion.
• Single-process or containerized micro-layered services (can evolve into microservices if needed).
d. Key technologies
• Python modules in /app/backend
• Streamlit for UI
• Vector store tech (FAISS, Pinecone, etc.)
• LLM API (OpenAI or similar)