feat(kit): add qdrant-agent mixin with in-process vector search and f… - #133
Open
N4si wants to merge 1 commit into
Open
feat(kit): add qdrant-agent mixin with in-process vector search and f…#133N4si wants to merge 1 commit into
N4si wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
qdrant-agent, a mixin that gives any sandbox agent Qdrant vector searchvia 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-agentQdrantClient(":memory:")— identical API to a production Qdrant servervector.pyhelper covering collection management, upsert, similarity search, payload filtering, and local embedding generation via fastembedQDRANT.mdwith working code examples for all operationsSpec choices worth flagging for review
In-process instead of Docker container — the
qdrant/qdrantDocker 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 viaqdrant-clientavoids 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 included —
qdrant-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()notsearch()— qdrant-client 1.18.0 removed the deprecatedsearch()method. The helper uses the current API.PATH via
/etc/sandbox-persistent.sh—profile.dand.bashrcare not sourced in non-interactive shells. Writing tosandbox-persistent.sh(sourced viaBASH_ENV) ensurespythonresolves 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) andredis-agent(#129).Test plan
sbx kit validate ./qdrant-agent/passes./scripts/test-kit.sh qdrant-agentpasses (51s)KIT_UNDER_TEST="$PWD/qdrant-agent" go test -tags=e2e -v -timeout 25m -count=1 -run TestE2EKit ./tck/...pythonresolves to venv in non-interactive shellcreate_collection,upsert,searchverified