How louis577-web/chatbot works
This Django application provides a French resource-search chatbot: a user submits a question, the service searches FAQ answers and educational resources, and returns a response with sources while recording the conversation. A separate indexing command downloads resource PDFs, extracts and embeds their text, and stores searchable chunks. The sampled code supports those service and indexing links; the views’ request-handling details are not sampled, so their internal routing is shown only at the application boundary.
Main entry points: services.py Answer service · views.py Chat views · recherche_contenu.py PDF text extraction · models.py Resource catalog
Components 15
Web interface
- Chat routes
chatbot/urls.py - Chat views
chatbot/views.py - Chat pages
chatbot/templates/chatbot/widget.html
Question answering
- Answer service
chatbot/services.py - FAQ matching
chatbot/services.py - Document search
chatbot/recherche_contenu.py
Document indexing
- Document indexer
chatbot/management/commands/indexer_documents.py - PDF text extraction
chatbot/recherche_contenu.py - Text embeddings
chatbot/recherche_contenu.py - Vector index
chatbot/recherche_contenu.py
Persistent data
- Resource catalog
site_principal/models.py - FAQ and conversations
chatbot/models.py
Other components
- Chat user
- Main-site database
- PDF object storage
Connections 17
- Chat user → Chat routes: submits question
- Chat routes → Chat views: routes request
- Chat views → Chat pages: renders page
- Chat views → Answer service: requests answer
- Answer service → FAQ matching: matches FAQ
- FAQ matching → FAQ and conversations: reads FAQ
- Answer service → Document search: searches documents
- Document search → Vector index: queries vectors
- Answer service → Resource catalog: loads resources
- Resource catalog → Main-site database: reads catalog
- Answer service → FAQ and conversations: saves conversation
- Answer service → Chat views: returns answer
- Document indexer → Resource catalog: lists resources
- Document indexer → PDF text extraction: indexes resource
- PDF text extraction → PDF object storage: downloads PDF
- PDF text extraction → Text embeddings: embeds chunks
- Text embeddings → Vector index: stores vectors