How dkwik/rag-knowledge-chatbot-django works
Main Components
A. Frontend Layer:
• Simple chat interface (HTML/Bootstrap/JavaScript)
• As a single component that handles user interactions
• Located in /templates directory
B. Backend Layer (Django):
• Main Django application structure
• URL routing and view handlers
• REST API endpoints for chat interactions
C. RAG System (Core):
• LangChain Agent Orchestrator
• LlamaIndex Retrieval System
• OpenAI Integration (LLM & Embeddings)
• Memory Management System (6-message context window)
D. Storage Layer:
• PGVector for vector storage
• Neo4J for graph-based knowledge representation (experimental)
Component Relationships
[User Interface] ←→ [Django Backend] ←→ [RAG System] ←→ [Storage Layer]
Detailed Component Breakdown
RAG System (expand this as a subsystem):
[Query Input] → [Agent Decision Layer] → [Retrieval Router]
• ↓
[Multiple Retrieval Strategies] ← [Document Processors]
Special Architectural Elements
A dedicated section showing the experimental RAG techniques:
• Small-to-Large Retrieval
• Recursive Retrieval
• Subquery Engine
• Graph Search (experimental)
Key Technical Details to Note
Callouts for:
• Document loading process (/doc_loader)
• Agentic behavior decision making
• Memory management system
• Vector storage mechanisms
• Integration points with OpenAI
Implementation Details
Configuration connections:
• Django settings
• Docker configuration (Neo4j)
• URL routing
• Template rendering