The fastest path to a working Compass integration is to paste the prompt below into your AI coding assistant. It tells the agent to read your codebase, work out where your data lives and what you’re trying to index, ask you any clarifying questions it needs, and then propose concrete integration code for your stack.
If you prefer to wire it up by hand, the rest of this page walks through the same flow manually.
You’ll:
Set your deployment URL and API key once. The rest of the page references them as $COMPASS_BASE_URL and $COMPASS_API_KEY:
Every request to a hosted Compass deployment is authenticated with a bearer token. Send Authorization: Bearer $COMPASS_API_KEY on every call. The examples below include it.
Compass exposes its running version from the health endpoint:
If you use an agent setup file from the Compass Console, compare the version returned by /health with the Version: listed in that file. If they differ, the setup file may still have useful credentials, but its embedded examples may be stale. Fetch the current docs before coding:
Create a collection named media with two named vector spaces: harrier for text search and qwen3-vl for cross-modal search on video frames.
Each chunk targets one vector space. Ingest a single segment twice: once as a text chunk (transcript) and once as a visual chunk (frame embedding). Both reference the same parent source via parent_ref.
Both chunks share the same file_id, chunk_index, and group_id but target different vector spaces. This is how Compass stores the same content in multiple embedding spaces.
Search both vector spaces at once. Compass runs BM25 against the text index, HNSW against each named vector space, merges all three result sets via RRF, and returns a single ranked list.
Response:
source tells you which retriever found the hit ("fts", "semantic", or "both"). score is the final value after RRF and any scoring boosts. parent_metadata is available in v0.3 and later, populated when the hit is a segment whose parent source (referenced by parent_ref) exists in the collection.
If you know the query is visual, skip the text space entirely:
Pass a string (not an array) to vector_space when you want a single space. Pass an array when you want RRF across multiple spaces.