KnowledgeProvider protocol with a deterministic TF-IDF-weighted extractive demo provider (never generative, always cites real excerpts) and a RAGcore HTTP adapter that degrades cleanly to unavailable. Knowledge nav + chat-style Q&A UI with source cards and honest grounded/insufficient/unavailable states. 57 backend tests passing, ruff clean. Fixed a real relevance bug (generic terms like "vehicle" crowding out distinctive matches) via IDF weighting, found by testing the actual S6 scenario. Verified end-to-end in the browser: grounded damage question cites both expected procedures; unrelated question honestly returns insufficient evidence with no fabrication.
16 lines
483 B
Docker
16 lines
483 B
Docker
FROM python:3.12-slim
|
|
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
|
WORKDIR /app
|
|
COPY backend/requirements.lock ./
|
|
RUN pip install --no-cache-dir -r requirements.lock
|
|
COPY backend/pyproject.toml ./
|
|
COPY backend/app ./app
|
|
COPY backend/alembic ./alembic
|
|
COPY backend/alembic.ini ./
|
|
COPY backend/tests ./tests
|
|
COPY seed ./seed
|
|
COPY knowledge ./knowledge
|
|
RUN pip install --no-cache-dir --no-deps -e .
|
|
EXPOSE 8000
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|