Modern, responsive web interface for the Docling RAG Agent with document management, web crawling, and AI chat capabilities.
uv sync
macOS:
brew install opus opusfile
Linux (Ubuntu/Debian):
sudo apt-get install libopus0 libopusfile0
Make sure your .env file is configured:
DATABASE_URL=postgresql://raguser:ragpass@localhost:5432/postgres
OPENAI_API_KEY=ollama
OPENAI_BASE_URL=http://localhost:11434/v1
LLM_CHOICE=mistral
EMBEDDING_MODEL=nomic-embed-text
uv run python web_app.py
The application will start at http://localhost:8000
Custom port:
uv run python web_app.py --port 8001
Disable auto-reload (production):
uv run python web_app.py --no-reload
Example questions:
Upload Files:
Ingest Documents:
documents)https://ai.pydantic.dev/)documents/crawled)βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Web Browser β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β Chat β β Documents β β Web Crawler β β
β β Interface β β Management β β Interface β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
β β /api/chat β β /api/ingest β β /api/crawl β β
β β (streaming)β β (background)β β (background) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RAG Agent + Tools β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β search_knowledge_base(query) -> relevant chunks β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PostgreSQL + PGVector β
β βββββββββββββββ βββββββββββββββββββββββββββββββββββββββ β
β β documents β β chunks (with vector embeddings) β β
β βββββββββββββββ βββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Check system health status |
/api/stats |
GET | Get knowledge base statistics |
| Endpoint | Method | Description |
|---|---|---|
/api/upload |
POST | Upload a document file |
/api/ingest |
POST | Start document ingestion |
/api/task/{task_id} |
GET | Get task status |
| Endpoint | Method | Description |
|---|---|---|
/api/crawl |
POST | Start web crawling |
/api/task/{task_id} |
GET | Get crawl task status |
| Endpoint | Method | Description |
|---|---|---|
/api/chat |
POST | Chat with streaming response (SSE) |
/api/chat/clear |
POST | Clear chat history |
| Option | Default | Description |
|---|---|---|
--port |
8000 | Port to run the server on |
--host |
0.0.0.0 | Host to bind to |
--reload |
True | Enable auto-reload on code changes |
--no-reload |
False | Disable auto-reload (for production) |
| Parameter | Default | Description |
|---|---|---|
chunk_size |
1000 | Tokens per chunk |
chunk_overlap |
200 | Overlap between chunks |
clean_before |
true | Clean existing data before ingestion |
| Parameter | Default | Description |
|---|---|---|
max_depth |
3 | Recursion depth (1-5) |
concurrency |
10 | Parallel requests (1-20) |
output_dir |
documents/crawled |
Output directory |
Error: βDatabase not initializedβ
Solution:
DATABASE_URL in .envError: βAgent not initializedβ
Solution:
OPENAI_API_KEY in .envollama serve)ollama pull mistral)Error: βCrawl failed: Chromium not foundβ
Solution:
# macOS
brew install chromium
# Ubuntu/Debian
sudo apt-get install chromium-browser
Error: βUpload failedβ
Solution:
documents/ directory exists and is writableuv run python web_app.py
The server will automatically reload on code changes.
View logs in the terminal where the server is running:
INFO: Started server process
INFO: Waiting for application startup
INFO: Application startup complete
INFO: Uvicorn running on http://0.0.0.0:8000
Enable verbose logging:
# In web_app.py, change:
uvicorn.run(
"web_app:app",
host="0.0.0.0",
port=8000,
reload=True,
log_level="debug" # Change from "info" to "debug"
)
The interface is fully responsive and works on:
β οΈ Important: This interface is designed for local development use. For production deployment:
web_app.py - FastAPI backendweb/index.html - Frontend interfaceweb_crawler/_crawl_utils.py - Crawl utilitiesingestion/ingest.py - Document ingestionrag_agent.py - RAG agent implementation