How pd241008/intellidoc-query works
IntelliDoc is a full-stack document-intelligence platform. Users upload documents for asynchronous processing and indexing, then query an owned document for semantic retrieval and streamed, document-grounded answers; the frontend also exposes authentication, status, and admin workflows. The graph preserves the separate auth service, ingestion and RAG stages, and storage/health concerns. Some frontend-to-service links and README-described capabilities are documented rather than visible in source excerpts; unsampled implementation details are not inferred.
Main entry points: rag_service.py RAG orchestrator · main.py FastAPI gateway · ingestion_tasks.py Clean, chunk, embed · route.ts Auth and OTP routes
Components 25
User interface
- Next.js application
frontend/src/app - Frontend API routes
frontend/src/app/api
Authentication and documents
- Auth service
auth/src/app.ts - Auth and OTP routes
auth/src/routes/otp/route.ts - User sync controller
auth/src/controllers/user_controller.ts - User records
auth/src/models/users.ts - Document metadata
auth/src/models/documents.ts
Backend API
- FastAPI gateway
backend/main.py - API router
backend/app/api/api_router.py - Upload API
backend/app/api/upload/upload.py - Query API
backend/app/api/query/query.py
Ingestion pipeline
- Ingestion trigger
backend/app/services/ingestion_service.py - Ingestion orchestrator
backend/app/middleware/workers/ingestion_pipeline/ingestion_pipeline.py - Clean, chunk, embed
backend/app/middleware/workers/ingestion_pipeline/tasks/ingestion_tasks.py
Retrieval and answers
- RAG orchestrator
backend/app/services/rag_service.py - Semantic search
backend/app/services/search_service.py - Query rewrite and answer
backend/app/services/llm_chain_service.py - Context builder
backend/app/rag/context_builder.py - LLM generation
backend/app/rag/llm.py
Storage and operations
- MongoDB repositories
backend/app/data_access/mongodb/document_repo.py - Chroma vector store
backend/app/database/chromadb/chromaconnection.py - Redis status and cache
backend/app/data_access/redis/redis_repo.py - Health and pipeline status
backend/app/core/config/health.py - Celery task queue
backend/app/middleware/workers/ingestion_pipeline/celery_app.py
Other components
- User
Connections 27
- User → Next.js application: uses
README.md - Next.js application → Frontend API routes: calls
README.md - Frontend API routes → FastAPI gateway: requests
README.md - FastAPI gateway → API router: registers
backend/main.py - User → Auth service: authenticates
README.md - Auth service → Auth and OTP routes: serves
- Auth and OTP routes → User records: syncs users
- Auth and OTP routes → Document metadata: reads and writes
- User → Upload API: uploads
README.md - Upload API → Ingestion trigger: triggers
- Ingestion trigger → Ingestion orchestrator: starts
backend/app/services/ingestion_service.py - Ingestion orchestrator → Clean, chunk, embed: chains tasks
backend/app/middleware/workers/ingestion_pipeline/ingestion_pipeline.py - Ingestion orchestrator → Health and pipeline status: marks status
backend/app/middleware/workers/ingestion_pipeline/ingestion_pipeline.py - Clean, chunk, embed → Celery task queue: runs on
backend/app/middleware/workers/ingestion_pipeline/tasks/ingestion_tasks.py - Clean, chunk, embed → Chroma vector store: stores embeddings
backend/app/middleware/workers/ingestion_pipeline/tasks/ingestion_tasks.py - Clean, chunk, embed → Redis status and cache: stores pipeline data
- User → Query API: submits query
README.md - Query API → RAG orchestrator: runs RAG
- RAG orchestrator → MongoDB repositories: checks ownership
backend/app/services/rag_service.py - RAG orchestrator → Semantic search: retrieves passages
backend/app/services/rag_service.py - RAG orchestrator → Query rewrite and answer: rewrites and streams
backend/app/services/rag_service.py - Query rewrite and answer → Context builder: builds context
backend/app/services/llm_chain_service.py - Query rewrite and answer → LLM generation: generates answer
backend/app/services/llm_chain_service.py - RAG orchestrator → Health and pipeline status: marks status
backend/app/services/rag_service.py - FastAPI gateway → Redis status and cache: checks connection
backend/main.py - FastAPI gateway → Chroma vector store: checks connection
backend/main.py - Health and pipeline status → Redis status and cache: reads and writes status
backend/app/core/config/health.py