Skip to content

feat: add docker-compose deployment and config for local embeddings - #1164

Open
vinbyte wants to merge 6 commits into
rohitg00:mainfrom
vinbyte:feat/docker-compose-deploy
Open

feat: add docker-compose deployment and config for local embeddings#1164
vinbyte wants to merge 6 commits into
rohitg00:mainfrom
vinbyte:feat/docker-compose-deploy

Conversation

@vinbyte

@vinbyte vinbyte commented Aug 8, 2026

Copy link
Copy Markdown

What this does

  • Configurable Local Embeddings: I updated LocalEmbeddingProvider in src/providers/embedding/local.ts so we can now pass the local model name and its dimensions via .env (LOCAL_EMBEDDING_MODEL and LOCAL_EMBEDDING_DIMENSIONS). If nothing is passed, it just defaults back to Xenova/all-MiniLM-L6-v2 (384) like before.
  • Standalone Docker Compose: I added a new deployment template under deploy/docker-compose/. Instead of pulling the pre-built image from NPM like the other templates, this one builds directly from the local source.

Why

  • I noticed that the local CPU-only embedding model (Xenova/all-MiniLM-L6-v2) was hardcoded. Since I wanted to test out different local models (like bge-small), it was a bit annoying having to edit the source code every time. This change makes it way easier to swap models just by editing the .env file.
  • There wasn't an easy out-of-the-box docker-compose setup in the deploy/ folder that builds from local source. This new setup makes it much faster to test local changes (like the embedding config above) inside a container without having to wait for an NPM release.

How to verify

  1. Clone the repo and go to deploy/docker-compose.
  2. Copy .env.example to .env.
  3. Set EMBEDDING_PROVIDER=local and fill in LOCAL_EMBEDDING_MODEL & LOCAL_EMBEDDING_DIMENSIONS if you want to try a different model.
  4. Run docker compose up --build.
  5. You should see the container build from source and boot up using your custom local embedding model.

unit test

Screenshot 2026-08-08 at 22 55 00

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added Docker Compose deployment support with persistent storage, health checks, configurable ports, bounded logging, and secure first-run setup.
    • Added configurable local embedding models and dimensions through environment settings.
    • Added configuration options for LLM providers and AgentMemory features.
  • Documentation

    • Updated the documented REST API endpoint count to 130.

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@vinbyte is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70c0b38e-c045-4087-af33-6af9e3f61ebe

📥 Commits

Reviewing files that changed from the base of the PR and between c7a9347 and 9bc9b7f.

📒 Files selected for processing (1)
  • deploy/docker-compose/docker-compose.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/docker-compose/docker-compose.yml

📝 Walkthrough

Walkthrough

The change adds Docker Compose deployment files, configures local embeddings through environment variables, and updates the documented and logged REST endpoint count from 129 to 130.

Changes

Docker deployment

Layer / File(s) Summary
Container image and service definition
deploy/docker-compose/Dockerfile, deploy/docker-compose/docker-compose.yml
Adds a multi-stage runtime image and an agentmemory Compose service with ports, persistent storage, healthchecks, restart behavior, and bounded logging.
Runtime environment and embeddings
deploy/docker-compose/.env.example, src/providers/embedding/local.ts
Defines LLM and AgentMemory settings. Local embeddings use configured model and dimension values with validation.
First-boot initialization
deploy/docker-compose/entrypoint.sh
Initializes /data, writes III configuration, persists an HMAC secret, and starts AgentMemory as the node user.

REST endpoint count

Layer / File(s) Summary
Endpoint count documentation and readiness output
AGENTS.md, README.md, src/index.ts
Updates the documented and startup-reported REST endpoint count to 130.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DockerCompose
  participant DockerImage
  participant Entrypoint
  participant DataVolume
  participant AgentMemory
  DockerCompose->>DockerImage: Build and start the service
  DockerImage->>Entrypoint: Launch through Tini
  Entrypoint->>DataVolume: Initialize data and persist HMAC secret
  Entrypoint->>AgentMemory: Start as node
  DockerCompose->>AgentMemory: Run liveness healthcheck
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the Docker Compose deployment and configurable local embedding changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vinbyte
vinbyte marked this pull request as ready for review August 8, 2026 15:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/docker-compose/entrypoint.sh`:
- Around line 85-90: Update the first-boot secret-generation output in the
entrypoint script to remove the line that echoes AGENTMEMORY_SECRET and its
value. Keep only a non-sensitive message indicating the HMAC secret was
generated, along with the existing storage and rotation guidance.

In `@src/providers/embedding/local.ts`:
- Around line 17-18: Update the dimensions initialization in the local embedding
provider constructor to validate LOCAL_EMBEDDING_DIMENSIONS with Number,
requiring a safe integer greater than zero; fall back to 384 when unset or
invalid, including fractional, partial, non-numeric, zero, and negative values.
Add tests covering unset, valid, fractional, non-numeric, zero, and negative
inputs.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e9cdd2df-0d6b-4736-9e0d-e6306b6be1d8

📥 Commits

Reviewing files that changed from the base of the PR and between d60652a and 6f068b0.

📒 Files selected for processing (8)
  • AGENTS.md
  • README.md
  • deploy/docker-compose/.env.example
  • deploy/docker-compose/Dockerfile
  • deploy/docker-compose/docker-compose.yml
  • deploy/docker-compose/entrypoint.sh
  • src/index.ts
  • src/providers/embedding/local.ts

Comment thread deploy/docker-compose/entrypoint.sh
Comment thread src/providers/embedding/local.ts Outdated
vinbyte and others added 5 commits August 8, 2026 23:05
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: vinbyte <hai@gavinda.dev>
…nt logs

Signed-off-by: vinbyte <hai@gavinda.dev>
… security

Signed-off-by: vinbyte <hai@gavinda.dev>
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