Skip to content

Commit 9f30e6f

Browse files
spashiiCharugundlavipuldtrn2048ussaama
authored
sync from testing (#458)
- assembly 3 pro for english, webhooks integration instead of poll - agentic chat v1 - cypress tests - fixes --------- Co-authored-by: charugundla <[email protected]> Co-authored-by: dtrn2048 <[email protected]> Co-authored-by: Vipul Charugundla <[email protected]> Co-authored-by: Usama <[email protected]> Co-authored-by: Usama <[email protected]>
1 parent e138301 commit 9f30e6f

File tree

201 files changed

+30388
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+30388
-568
lines changed

.github/workflows/deploy-testing.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,35 @@ jobs:
5353
cache-from: type=gha
5454
cache-to: type=gha,mode=max
5555

56+
build-agent:
57+
name: Build & Push Agent Service
58+
runs-on: ubuntu-latest
59+
needs: [generate-tag]
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Set up Docker Buildx
64+
uses: docker/setup-buildx-action@v3
65+
66+
- name: Log in to DigitalOcean Container Registry
67+
uses: docker/login-action@v3
68+
with:
69+
registry: ${{ env.REGISTRY }}
70+
username: ${{ secrets.DO_REGISTRY_TOKEN }}
71+
password: ${{ secrets.DO_REGISTRY_TOKEN }}
72+
73+
- name: Build and Push Agent Service
74+
uses: docker/build-push-action@v5
75+
with:
76+
context: ./echo/agent
77+
file: ./echo/agent/Dockerfile
78+
push: true
79+
tags: |
80+
${{ env.REGISTRY }}/dbr-echo-agent:${{ needs.generate-tag.outputs.image-tag }}
81+
${{ env.REGISTRY }}/dbr-echo-agent:testing
82+
cache-from: type=gha
83+
cache-to: type=gha,mode=max
84+
5685
build-directus:
5786
name: Build & Push Directus
5887
runs-on: ubuntu-latest
@@ -217,7 +246,7 @@ jobs:
217246
update-gitops:
218247
name: Update GitOps Repo
219248
runs-on: ubuntu-latest
220-
needs: [generate-tag, build-api, build-directus]
249+
needs: [generate-tag, build-api, build-agent, build-directus]
221250
steps:
222251
- name: Checkout GitOps repo
223252
uses: actions/checkout@v4

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ echo/server/dembrane/audio_lightrag/data/progress_tracker.csv
1010
echo/server/test.py
1111
echo/server/wandb*
1212

13+
# Python virtual environments
14+
.venv/
15+
.venv-*/
16+
**/venv/
17+
**/.venv/
18+
**/.venv-*/
19+
20+
# Local documentation (not committed)
21+
CLAUDE.md
22+
IMPLEMENTATION_PLANS/
1323

1424
*.env
1525
notes_*.md

contributors.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
- RubenNair
66
- vanpauli
77
- MsVivienne
8+
- dtrn2048
9+
- Charugundlavipul

echo/.devcontainer/docker-compose.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ services:
8080
- postgres
8181
- redis
8282

83+
agent:
84+
build:
85+
context: ../agent
86+
dockerfile: Dockerfile
87+
ports:
88+
- 8001:8001
89+
environment:
90+
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
91+
- ECHO_API_URL=http://devcontainer:8000/api
92+
- AGENT_CORS_ORIGINS=http://localhost:5173,http://localhost:5174
93+
networks:
94+
- dembrane-network
95+
depends_on:
96+
- devcontainer
97+
8398
devcontainer:
8499
build:
85100
context: ../server
@@ -123,4 +138,4 @@ services:
123138

124139
networks:
125140
dembrane-network:
126-
driver: bridge
141+
driver: bridge

echo/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ directus/.env
1414
*.sql
1515
node_modules
1616
.next
17+
cypress/test-suites/.cypress-cache/
1718

1819
celerybeat-schedule.db
1920

@@ -28,3 +29,5 @@ __queuestorage__echo/server/dembrane/workspace_script.py
2829

2930
tools/translator
3031
echo-gitops/
32+
33+
cypress/reports/

echo/AGENTS.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,43 @@ Convention: Use `ENABLE_*` naming pattern for feature flags.
110110
# Frontend
111111
cd frontend && pnpm i && pnpm dev
112112

113-
# Backend
114-
cd server && uv sync && uv run uvicorn dembrane.main:app --reload
113+
# Backend API
114+
cd server && uv sync && uv run uvicorn dembrane.main:app --port 8000 --reload --loop asyncio
115+
116+
# Agent service (required for agentic chat)
117+
cd ../agent && uv sync && uv run uvicorn main:app --host 0.0.0.0 --port 8001 --reload
118+
```
119+
120+
For full background processing (transcription/audio and non-agentic jobs), also run:
121+
122+
```bash
123+
cd server
124+
uv run dramatiq-gevent --watch ./dembrane --queues network --processes 2 --threads 1 dembrane.tasks
125+
uv run dramatiq --watch ./dembrane --queues cpu --processes 1 --threads 1 dembrane.tasks
126+
```
127+
128+
Agentic chat execution is stream-first through `POST /api/agentic/runs/{run_id}/stream` and no longer enqueues an agentic Dramatiq actor.
129+
130+
### Future Agent Tool Development
131+
132+
- Add tool definitions in `agent/agent.py` (`@tool` functions in `create_agent_graph`).
133+
- Add shared API client calls for tools in `agent/echo_client.py`.
134+
- If a tool needs new data, expose it via `server/dembrane/api/agentic.py` and/or `server/dembrane/service/`.
135+
- Add tests in `agent/tests/test_agent_tools.py` and `server/tests/test_agentic_api.py`.
136+
137+
### Inspect Local Agentic Conversations
138+
139+
Use the local script from repo root:
140+
141+
```bash
142+
bash echo/server/scripts/agentic/latest_runs.sh --chat-id <chat_uuid> --limit 3 --events 80
143+
```
144+
145+
Common variants:
146+
147+
```bash
148+
bash echo/server/scripts/agentic/latest_runs.sh --run-id <run_uuid> --events 120
149+
bash echo/server/scripts/agentic/latest_runs.sh --chat-id <chat_uuid> --limit 1 --events 200 --json
115150
```
116151

117152
## Important Files

echo/agent/.env.sample

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GEMINI_API_KEY=
2+
ECHO_API_URL=http://host.docker.internal:8000/api
3+
LLM_MODEL=gemini-3-pro-preview
4+
AGENT_GRAPH_RECURSION_LIMIT=80
5+
AGENT_CORS_ORIGINS=http://localhost:5173,http://localhost:5174

echo/agent/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__pycache__/
2+
*.py[cod]
3+
.pytest_cache/
4+
.mypy_cache/

echo/agent/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.11-slim AS base
2+
3+
ENV PYTHONDONTWRITEBYTECODE=1
4+
ENV PYTHONUNBUFFERED=1
5+
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends curl ca-certificates \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
11+
12+
WORKDIR /app
13+
COPY pyproject.toml ./
14+
RUN uv sync --frozen || uv sync
15+
16+
COPY . .
17+
18+
EXPOSE 8001
19+
20+
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]

echo/agent/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Echo Agent Service
2+
3+
Isolated CopilotKit/LangGraph runtime for Agentic Chat.
4+
5+
## Why This Service Exists
6+
7+
- Keeps agent execution out of the frontend runtime.
8+
- Avoids dependency conflicts with `echo/server`.
9+
- Supports long-running execution and backend-owned run lifecycle.
10+
11+
## Local Run
12+
13+
```bash
14+
cd echo/agent
15+
cp .env.sample .env
16+
# set GEMINI_API_KEY in .env
17+
uv sync
18+
uv run uvicorn main:app --host 0.0.0.0 --port 8001 --reload
19+
```
20+
21+
## Docker Run
22+
23+
```bash
24+
cd echo/agent
25+
docker build -t echo-agent:local .
26+
docker run --rm -p 8001:8001 --env-file .env echo-agent:local
27+
```
28+
29+
## Endpoints
30+
31+
- `GET /health`
32+
- `POST /copilotkit/{project_id}`
33+
34+
## Notes
35+
36+
- This service is intentionally scoped to one purpose: agentic chat execution.
37+
- Auth, persistence, and notifications should be owned by `echo/server` gateway routes.

0 commit comments

Comments
 (0)