How smarthtix-design/local-ai-chat-web-app works
This is a local Ollama-backed web chat with optional document RAG and internet search. Users enter through the browser UI, send chat requests to the Python server, and receive streamed answers with retrieved sources when RAG is enabled. Administrators can manage settings, while documents are extracted, chunked, embedded, and indexed for later search. The graph preserves upload and URL-ingestion capabilities visible in the server excerpt. Some server internals are unsampled, so their links to dependencies are dashed where the excerpts do not establish the call.
Main entry points: server.py HTTP server · ingest.py Document indexing · index.html Chat interface · retrieval.py Hybrid retrieval
Components 17
Web interfaces
- Chat interface
index.html - Admin interface
admin.html
Chat server
- HTTP server
server.py - Chat and streaming
server.py - Access and rate limits
server.py - Admin controls
server.py - Uploads and URL intake
server.py - Web search
server.py - Usage and feedback
stats.py
Knowledge retrieval
- Document indexing
rag/ingest.py - Hybrid retrieval
retrieval.py - Safe page extraction
webtools.py - Persistent vectors
chroma_db - Shared documents
documents
External services
- Ollama
- Search providers
Other components
- Chat visitor
Connections 18
- Chat visitor → Chat interface: uses
README.txt - Chat interface → HTTP server: sends requests
README.txt - Admin interface → HTTP server: admin requests
server.py - HTTP server → Access and rate limits: checks access
server.py - HTTP server → Chat and streaming: routes chat
server.py - HTTP server → Admin controls: routes admin
server.py - HTTP server → Uploads and URL intake: handles uploads
server.py - Chat and streaming → Hybrid retrieval: searches documents
server.py - Chat and streaming → Ollama: requests generation
- Chat and streaming → Web search: may search web
server.py - Web search → Search providers: queries providers
server.py - Web search → Safe page extraction: fetches pages
server.py - Shared documents → Document indexing: indexes files
README.txt - Document indexing → Safe page extraction: extracts HTML
rag/ingest.py - Document indexing → Ollama: embeds chunks
rag/ingest.py - Document indexing → Persistent vectors: writes vectors
rag/ingest.py - Hybrid retrieval → Persistent vectors: searches vectors
- Chat and streaming → Usage and feedback: logs usage
server.py