Skip to content

feat(kit): add qdrant-agent mixin with in-process vector search and f… - #133

Open
N4si wants to merge 1 commit into
docker:mainfrom
N4si:feat/qdrant-agent
Open

feat(kit): add qdrant-agent mixin with in-process vector search and f…#133
N4si wants to merge 1 commit into
docker:mainfrom
N4si:feat/qdrant-agent

Conversation

@N4si

@N4si N4si commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Adds qdrant-agent, a mixin that gives any sandbox agent Qdrant vector search
via qdrant-client running in-process. No external service, Docker daemon, or
credentials required. Works on top of any agent regardless of base image.

Includes:

  • qdrant-client[fastembed] installed in an isolated venv at /opt/qdrant-agent
  • In-process QdrantClient(":memory:") — identical API to a production Qdrant server
  • vector.py helper covering collection management, upsert, similarity search, payload filtering, and local embedding generation via fastembed
  • QDRANT.md with working code examples for all operations

Spec choices worth flagging for review

In-process instead of Docker container — the qdrant/qdrant Docker image uses jemalloc which aborts on non-4KB kernel page sizes. The sbx microVM uses 16KB pages on ARM64, causing an immediate crash on every version of the standard image tested. Running in-process via qdrant-client avoids this entirely, works on every architecture, and requires no Docker Hub network access.

No Docker daemon dependency — unlike mixins that require shell-docker based agents for DinD, this mixin works on top of any agent regardless of base image.

fastembed includedqdrant-client[fastembed] ships a local embedding model (BAAI/bge-small-en-v1.5, ~40 MB). Developers get end-to-end vector search without an external embedding API or API key.

query_points() not search() — qdrant-client 1.18.0 removed the deprecated search() method. The helper uses the current API.

PATH via /etc/sandbox-persistent.shprofile.d and .bashrc are not sourced in non-interactive shells. Writing to sandbox-persistent.sh (sourced via BASH_ENV) ensures python resolves to the venv in every shell context including agent tool calls.

Origin

Community contribution. Third in a series of data infrastructure mixins alongside postgres-agent (#128) and redis-agent (#129).

Test plan

  • sbx kit validate ./qdrant-agent/ passes
  • ./scripts/test-kit.sh qdrant-agent passes (51s)
  • e2e passes (99s) — KIT_UNDER_TEST="$PWD/qdrant-agent" go test -tags=e2e -v -timeout 25m -count=1 -run TestE2EKit ./tck/...
  • Manual smoke test on Apple Silicon (arm64, macOS):
    • python resolves to venv in non-interactive shell
    • create_collection, upsert, search verified
    • Cosine similarity returns correctly ranked results (0.991, 0.830)

@N4si
N4si requested a review from a team as a code owner July 8, 2026 18:36
…astembed

Adds qdrant-agent, a mixin that gives any sandbox agent Qdrant vector
search via qdrant-client running in-process. No external service, Docker
daemon, or credentials required.

Includes:
- qdrant-client[fastembed] installed in an isolated venv at /opt/qdrant-agent
- In-process QdrantClient(':memory:') — same API as a production Qdrant server
- vector.py helper covering collection management, upsert, similarity search,
  payload filtering, and local embedding generation via fastembed
- QDRANT.md with usage examples for all operations
- PATH wired via /etc/sandbox-persistent.sh for non-interactive agent shells

Spec choices:
- kind: mixin — Qdrant is a backing service; layers on top of any agent
- In-process instead of Docker container — the qdrant/qdrant image uses jemalloc
  which aborts on non-4KB kernel page sizes (the sbx microVM uses 16KB pages on
  ARM64). Running in-process via qdrant-client avoids this entirely and works on
  every architecture.
- No Docker Hub domains in allowedDomains — no container is pulled at all
- fastembed included — developers can generate embeddings locally without an
  external embedding API or API key
- qdrant-client 1.18.0 uses query_points() not the deprecated search() method

Test plan:
- sbx kit validate passes
- TCK passes in 51s
- e2e passes in 99s
- Manual smoke: create_collection, upsert, search with cosine similarity —
  correct ranked results confirmed on Apple Silicon (arm64, macOS)

Signed-off-by: Nasi Chaudhari <chaudharinasi@gmail.com>
@N4si
N4si force-pushed the feat/qdrant-agent branch from 4d59e9f to 729877c Compare July 8, 2026 18:45
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