How 9bishal/enterprise-document-intelligence-system- works
The product is an organization-facing document intelligence system: users upload departmental documents, which are indexed for semantic and lexical retrieval; they then query the scoped corpus in persistent chat sessions and receive streamed, source-attributed answers. The map follows the documented Django REST application and React client. It also includes the documented hybrid retrieval, admin, and caching capabilities; their detailed internal wiring is not fully shown in the sampled source, so uncertain links are omitted. The tree and excerpts also contain a separate FastAPI implementation, which is not mapped as part of the documented Django workflow.
Main entry points: urls.py API routing · rag_graph.py RAG orchestration · App.jsx App routing · rag.py Chat endpoints
Components 24
Web client
- App routing
frontend/src/App.jsx - Chat and sessions
frontend/src/pages/QueryPage.jsx - Document workspace
frontend/src/pages/DocumentsPage.jsx - Admin console
frontend/src/components/AdminDashboard.jsx
API and access
- API routing
backend/django_backend/urls.py - Authentication
backend/django_backend/views/auth.py - Document endpoints
backend/django_backend/views/documents.py - Chat endpoints
backend/django_backend/views/rag.py - Admin endpoints
backend/django_backend/views/admin.py - LLM configuration
backend/django_backend/views/admin_llm.py - Role permissions
backend/django_backend/permissions.py
Document indexing
- Indexing endpoints
backend/django_backend/views/doc_indexing.py - Chunk and classify
backend/app/semantic_chunk.py - Vector index
backend/app/vector_store.py
RAG answering
- RAG orchestration
backend/app/rag_graph.py - Hybrid retrieval
backend/app/retrieval/hybrid.py - Lexical search
backend/app/retrieval/bm25.py - Result reranking
backend/app/retrieval/reranker.py - Context assembly
backend/app/retrieval/context_builder.py
State and operations
- Application database
backend/django_backend/models.py - Cache manager
backend/django_backend/cache/manager.py
Other components
- Organization user
- LLM provider
- Redis cache
Connections 32
- Organization user → App routing: uses
- App routing → Chat and sessions: routes to
- App routing → Document workspace: routes to
- App routing → Admin console: routes to
- Chat and sessions → API routing: requests chat
- Document workspace → API routing: requests documents
- Admin console → API routing: requests admin
- API routing → Authentication: dispatches
- API routing → Document endpoints: dispatches
- API routing → Indexing endpoints: dispatches
- API routing → Chat endpoints: dispatches
- API routing → Admin endpoints: dispatches
- API routing → LLM configuration: dispatches
- Authentication → Role permissions: checks access
- Document endpoints → Role permissions: checks access
- Chat endpoints → Role permissions: checks access
- Admin endpoints → Role permissions: checks access
- Indexing endpoints → Chunk and classify: indexes content
- Chunk and classify → Vector index: writes chunks
- Document endpoints → Application database: reads and writes
- Indexing endpoints → Application database: records status
- Chat endpoints → Application database: stores chat
- Chat endpoints → RAG orchestration: runs query
- RAG orchestration → Vector index: searches vectors
- RAG orchestration → Hybrid retrieval: retrieves passages
- Hybrid retrieval → Lexical search: combines lexical search
- Hybrid retrieval → Result reranking: reranks results
- RAG orchestration → Context assembly: builds context
- RAG orchestration → LLM provider: requests generation
- LLM configuration → Application database: saves configuration
- RAG orchestration → Cache manager: uses caches
- Cache manager → Redis cache: reads and writes