Skip to content

Run the Python intelligence layer as a Docker Compose service#8

Merged
Yashasm18 merged 1 commit into
mainfrom
feat/dockerize-intelligence-layer
Jul 14, 2026
Merged

Run the Python intelligence layer as a Docker Compose service#8
Yashasm18 merged 1 commit into
mainfrom
feat/dockerize-intelligence-layer

Conversation

@Yashasm18

Copy link
Copy Markdown
Owner

Summary

Makes the NLP knowledge-graph feature work out of the box. The Python intelligence layer (entity + relationship extraction) existed but was never part of the stack, so it was off by default and required a manual uvicorn start. Since Docker is already a prerequisite, this makes it a first-class compose service — docker compose up -d now brings it up with Qdrant/Ollama/the app.

  • New services/python-agent/Dockerfile: python:3.11-slim, CPU-only PyTorch (keeps the image ~800MB instead of the ~2.5GB CUDA build), with spaCy (en_core_web_sm) and sentence-transformers (all-MiniLM-L6-v2) models baked in so the first request is instant and offline-safe. Container healthcheck on /health.
  • docker-compose.yml: adds the python-agent service, wires PYTHON_SERVICE_URL=http://python-agent:8000 into the app container, and adds it to depends_on (service_started — the agent already degrades gracefully while it warms up).
  • SETUP.md: notes the larger first build and the best-effort behaviour.

Test plan

  • Compose structure/indentation verified; PYTHON_SERVICE_URL + depends_on wired
  • Model names match memory_intelligence.py (en_core_web_sm, all-MiniLM-L6-v2); uvicorn entrypoint path (app.main:app) matches the package layout
  • Agent's best-effort call + graceful degradation already verified end-to-end in prior PRs
  • Image build not run in this environment (no Docker daemon here) — uses standard Docker patterns; first docker compose up --build will build it

🤖 Generated with Claude Code

The NLP service (entity/relationship extraction -> knowledge graph) was
built but never part of the stack, so its features were off by default
and users had to start it by hand. Since Docker is already a prerequisite,
make it a first-class compose service so `docker compose up -d` brings it
up with everything else.

- Add services/python-agent/Dockerfile: python:3.11-slim, CPU-only torch
  (keeps the image ~800MB instead of ~2.5GB CUDA build), spaCy and
  sentence-transformers models baked in so the first request is instant
  and offline-safe.
- Add the python-agent service to docker-compose.yml with a healthcheck,
  wire PYTHON_SERVICE_URL=http://python-agent:8000 into the app container,
  and add it to depends_on (service_started — the agent already degrades
  gracefully if it's still warming up).
- Note the larger first build + best-effort behaviour in SETUP.md.

Standard Docker patterns; image build not run here (no Docker daemon in
this environment). Model names match memory_intelligence.py
(en_core_web_sm, all-MiniLM-L6-v2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Yashasm18
Yashasm18 merged commit c1a8c29 into main Jul 14, 2026
2 checks passed
@Yashasm18
Yashasm18 deleted the feat/dockerize-intelligence-layer branch July 14, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant