## Summary - Closes Phases 1–3 of [#62](#62) (Phase 4 eval harness left for a follow-up). - **Accuracy:** Retrieval is decided every turn (`GroundingDecider`, fails open). `FAST` no longer skips search — it only selects `OLLAMA_MODEL_FAST`. Search failures surface an explicit error instead of hallucinating from parametric memory. - **Search:** Pluggable `services/search/` with **SearxNG primary** + DDGS failover, ranking/dedupe/rumour filtering, numbered dated source blocks, citations persisted on `Prompt.citations` and emitted as `{"v":1,"type":"citations",...}` after stream end. - **Models:** Role-scoped `OLLAMA_MODEL_THINKING` / `_FAST` / `_UTILITY` / `OLLAMA_EMBED_MODEL=nomic-embed-text`, configurable `num_ctx`, real model name on `PromptMetric`, `reindex_embeddings` management command + loud embedding-dimension mismatch. ## SearxNG (ops) See README **SearxNG** section. Short version: run `searxng/searxng` on the GPU host, enable `json` in `settings.yml`, set `SEARXNG_BASE_URL=http://10.0.0.128:8080` in prod/beta secrets, open `:8080` on the LAN firewall like Ollama. ## Test plan - [x] `SKIP_RAG_INIT=1 python manage.py test chat_backend.tests` — 442 OK (6 skipped) - [ ] Deploy beta with updated secrets (`OLLAMA_MODEL_*`, `OLLAMA_EMBED_MODEL=nomic-embed-text`, `SEARXNG_BASE_URL`) - [ ] After embed change: `python manage.py reindex_embeddings` - [ ] Verify `did Taylor Swift get married` in FAST and THINKING returns grounded answer with citations frame - [ ] Kill SearxNG and confirm factual turns return search_unavailable (not Joe Alwyn hallucination); non-factual chat still worksReviewed-on: #65
60 lines
1.5 KiB
TOML
60 lines
1.5 KiB
TOML
[project]
|
|
name = "chat-backend"
|
|
version = "0.1.0"
|
|
description = "Django chat backend for AIML Operations"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"Django==6.0",
|
|
"channels==4.3.2",
|
|
"daphne==4.2.1",
|
|
"uvicorn==0.38.0",
|
|
"gunicorn==23.0.0",
|
|
"psycopg2-binary==2.9.10",
|
|
"whitenoise==6.9.0",
|
|
"djangorestframework==3.16.1",
|
|
"djangorestframework-simplejwt==5.5.1",
|
|
"django-cors-headers==4.9.0",
|
|
"django-autoslug==1.9.9",
|
|
"django-filter==25.2",
|
|
"ollama==0.6.1",
|
|
"langchain==1.3.14",
|
|
"langchain-core==1.5.1",
|
|
"langchain-community==0.4.2",
|
|
"langchain-classic==1.0.8",
|
|
"langchain-ollama==1.1.0",
|
|
"langchain-chroma==1.1.0",
|
|
"langchain-text-splitters==1.1.2",
|
|
# langgraph stack is no longer force-pinned. langchain / langgraph
|
|
# require langchain-core>=1.4.7 (Reviver allowed_objects). Let
|
|
# langgraph resolve checkpoint / prebuilt / sdk transitively.
|
|
# Supported: langgraph>=1.2.5,<1.3 (matches langchain 1.3.x).
|
|
"langgraph>=1.2.5,<1.3.0",
|
|
"chromadb==1.3.5",
|
|
"unstructured==0.18.21",
|
|
"pypdf==6.4.0",
|
|
"python-docx==1.2.0",
|
|
"docx2txt==0.8",
|
|
"openpyxl==3.1.5",
|
|
"pandas==2.3.3",
|
|
"numpy==2.2.6",
|
|
"matplotlib==3.10.7",
|
|
"pillow==12.0.0",
|
|
"beautifulsoup4==4.14.3",
|
|
"ddgs==9.9.3",
|
|
"requests>=2.32,<3",
|
|
"httpx==0.28.1",
|
|
"python-dateutil==2.9.0.post0",
|
|
"pytz==2025.2",
|
|
"stripe>=12.0.0,<14.0.0",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"parameterized==0.9.0",
|
|
"black==25.11.0",
|
|
]
|
|
|
|
[tool.uv]
|
|
package = false
|