How aleena-azam510/cognifile-ai works
Cognifile AI is a document-intelligence application: users upload PDFs, browse their library, ask document-grounded questions with source references, and inspect extracted topics. Upload requests enter FastAPI and are processed through PDF extraction, chunking, embeddings, vector indexing, and SQLite registration; question requests retrieve indexed passages before Gemini generates an answer. The graph also preserves deletion and topic-intelligence capabilities. Source excerpts support the principal service calls; README documents broader capabilities, while several frontend and backend implementation details were not sampled.
Main entry points: main.py REST API · document_service.py Ingestion coordinator · rag_service.py RAG answer service · api.ts API client
Components 18
User experience
- Document dashboard
frontend/src/App.tsx - AI chat
frontend/src/components/ChatWorkspace.tsx - Topic explorer
frontend/src/components/intelligence/IntelligenceHub.tsx - API client
frontend/src/services/api.ts
API orchestration
- REST API
app/main.py - Document deletion
app/services/document_deletion_service.py
Document ingestion
- Ingestion coordinator
app/services/document_service.py - PDF extraction
app/services/pdf_service.py - Text chunking
app/services/chunking_service.py - Embedding generation
app/services/embedding_service.py
Search and intelligence
- RAG answer service
app/services/rag_service.py - Answer generation
app/services/llm_service.py - Topic extraction
app/services/topic_service.py
Persistence
- Document registry
app/services/document_registry.py - Vector index
app/services/vector_service.py - Uploaded PDFs
app/main.py
Other components
- User
- Google Gemini
Connections 26
- User → Document dashboard: uses
README.md - Document dashboard → API client: requests
frontend/src/App.tsx - AI chat → API client: asks
frontend/src/components/ChatWorkspace.tsx - Topic explorer → API client: loads topics
frontend/src/components/intelligence/IntelligenceHub.tsx - API client → REST API: HTTP requests
README.md - REST API → Ingestion coordinator: ingests PDF
app/main.py - REST API → RAG answer service: answers question
app/main.py - REST API → Document registry: lists and reads
app/main.py - REST API → Topic extraction: extracts topics
app/main.py - REST API → Document deletion: deletes document
app/main.py - REST API → Uploaded PDFs: saves upload
app/main.py - Ingestion coordinator → PDF extraction: extracts text
app/services/document_service.py - Ingestion coordinator → Text chunking: creates chunks
app/services/document_service.py - Ingestion coordinator → Embedding generation: embeds chunks
app/services/document_service.py - Ingestion coordinator → Vector index: stores embeddings
app/services/document_service.py - Ingestion coordinator → Document registry: registers metadata
app/services/document_service.py - RAG answer service → Embedding generation: embeds query
app/services/rag_service.py - RAG answer service → Vector index: searches passages
app/services/rag_service.py - RAG answer service → Answer generation: generates answer
app/services/rag_service.py - Answer generation → Google Gemini: generates content
app/services/llm_service.py - Topic extraction → Vector index: reads chunks
app/services/topic_service.py - Document deletion → Document registry: removes metadata
app/services/document_deletion_service.py - Document deletion → Vector index: removes vectors
app/services/document_deletion_service.py - Document registry → Uploaded PDFs: tracks file path
app/services/document_registry.py - RAG answer service → AI chat: returns cited answer
README.md - Topic extraction → Topic explorer: returns topic results
README.md