Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.git/
.github/
.venv/
__pycache__/
*.py[cod]
.pytest_cache/
.ruff_cache/
.mypy_cache/

.env
.env.*
!.env.example

data/raw/*
!data/raw/.gitkeep
data/processed/*
!data/processed/.gitkeep
data/logs/*
!data/logs/.gitkeep
data/memory.db
data/memory.db-*

eval/results/*
!eval/results/.gitkeep

Dockerfile
docker-compose.yml
README.md
docs/
tests/
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_LINK_MODE=copy \
PATH="/app/.venv/bin:$PATH"

WORKDIR /app

RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir uv

COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev --no-install-project \
&& rm -rf /root/.cache/uv

COPY src ./src
COPY ui ./ui
COPY scripts ./scripts

EXPOSE 8000 8501

CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,21 @@ uvicorn src.api.main:app --reload
# UI
streamlit run ui/app.py
```

## Docker

```bash
docker compose up --build
```

- UI: http://localhost:8501
- API docs: http://localhost:8000/docs
- Health: http://localhost:8000/health
- Docker image excludes offline evaluation dependencies such as RAGAS.

## Evaluation

```bash
uv sync --extra eval
uv run --extra eval python eval/run_eval.py --help
```
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,42 @@ services:
- qdrant_storage:/qdrant/storage
restart: unless-stopped

api:
image: rag-agent-app:latest
build:
context: .
container_name: rag_memory_api
env_file:
- .env
environment:
QDRANT_URL: http://qdrant:6333
command: uvicorn src.api.main:app --host 0.0.0.0 --port 8000
ports:
- "8000:8000"
volumes:
- ./data:/app/data
depends_on:
- qdrant
restart: unless-stopped

ui:
image: rag-agent-app:latest
build:
context: .
container_name: rag_memory_ui
env_file:
- .env
environment:
API_BASE: http://api:8000
QDRANT_URL: http://qdrant:6333
command: streamlit run ui/app.py --server.address=0.0.0.0 --server.port=8501
ports:
- "8501:8501"
volumes:
- ./data:/app/data
depends_on:
- api
restart: unless-stopped

volumes:
qdrant_storage:
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ dependencies = [
# UI
"streamlit>=1.40",

# Evaluation
"ragas>=0.2",

# Observability
"langfuse>=2.50",
"loguru>=0.7",
Expand All @@ -48,6 +45,9 @@ dependencies = [
]

[project.optional-dependencies]
eval = [
"ragas>=0.2",
]
dev = [
"pytest>=8.3",
"pytest-asyncio>=0.24",
Expand Down
3 changes: 2 additions & 1 deletion ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import asyncio
import json
import os
from collections.abc import AsyncIterator, Iterator
from pathlib import Path
from typing import Any

import httpx
import streamlit as st

API_BASE = "http://localhost:8000"
API_BASE = os.getenv("API_BASE", "http://localhost:8000")


def http_client() -> httpx.Client:
Expand Down
8 changes: 5 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading