Jump to the manifest
semantic-search.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.At a glance
How the pieces connect
Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.Deploy it
1
Get the manifest
2
Validate it
Validate runs every check apply runs and creates nothing. Fix each entry in
errors, then run it again.3
Apply it
Apply creates every resource in one call. The response lists each resource with its outcome in
wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.Run the first query
Look up the namespace id by name, then runkb-search. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.
Add your own data
Each object you add to a bucket is processed by every collection that reads it. This adds one object toknowledge-base. NAMESPACE_ID is the id from the namespace lookup above.
PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.
Retrievers
kb-search
Ask a question in plain words and get back the article chunks closest in meaning, best first.
Stages: feature_search
Searches: kb-chunks
kb-hybrid
The same question searched two ways, by meaning and by BM25 keywords, fused by rank, so exact tokens such as an error code or a header name also count.
Stages: feature_search
Searches: kb-chunks
Collections
Each collection runs one extractor over a bucket, or over another collection’s documents.kb-chunks
kb-chunks
text_extractor@v1 over bucket knowledge-base: each article split into chunks of 3 sentences, overlapping by 1, and each chunk embedded. Feeds kb-search and kb-hybrid.Reads bucket
knowledge-base with text_extractor v1.Inputs: text ← contentCopied onto each document: title, category, tagsThe manifest
Every resource above comes from this file. Change it and apply it again with?mode=upsert to update what exists. Manifests documents each field.
semantic-search.namespace.yaml
Hand it to an agent
Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown athttps://mixpeek.com/docs/templates/semantic-search.md.
Prompt
How it works
Each article you upload goes through three steps before you can search it.- Chunking.
text_extractorreads the bucket’scontentproperty (theinput_mappingslinetext: content) and splits it withsplit_by: sentences,chunk_size: 3andchunk_overlap: 1. Each chunk holds 3 sentences, and its last sentence opens the next chunk, so the two sentences on either side of a boundary also appear together in one chunk. - Embedding. Each chunk becomes one document with its text in
textand a 1024-dimension vector frommultilingual-e5-large-instruct, the extractor’s default text model. The model covers more than 100 languages, so a question in one language can match an article written in another. - Passthrough.
field_passthroughcopiestitle,categoryandtagsfrom the object onto every chunk, at the same paths. You filter oncategorywithout joining back to the bucket.
text index on text is what the BM25 search in kb-hybrid matches against. The keyword index on category serves the filters further down this page.
Both retrievers name the feature as mixpeek://text_extractor@v1. The text extractor has one vector index, so the URI needs no index name after the version.
Each change below is an edit to one block of the manifest. Apply the file again with ?mode=upsert to patch what exists.
Dense search or hybrid search
kb-search embeds your query and compares it with every chunk by meaning. It suits questions phrased the way a user asks them, such as the first query above, which the rate-limits article answers in other words.
Dense vectors are weaker on exact tokens: an error code, a header name, a product SKU. kb-hybrid runs a second search with lexical: true, which matches the query’s words against the text index with BM25 and searches no vector. fusion: rrf merges the two ranked lists by position, so the gap between cosine scores and BM25 scores does not matter.
Run the same token query against both retrievers and compare the order of documents:
cURL
A search with
lexical: true replaces the dense search for that entry. Hybrid retrieval needs both entries in searches, as kb-hybrid has them. A single lexical: true entry is keyword search alone.fusion to dbsf and give each search a weight. DBSF scales each search’s scores to 0 to 1 before it adds them, so the weights act on comparable numbers. Under rrf a weight moves ranks only slightly.
kb-hybrid stages, keywords weighted higher
Filter by metadata
Every chunk carries its article’scategory. Filter on it per request or in the retriever.
- Per request
- In the retriever
Send
filters in the execute body. The retriever ANDs it with any filter its stages already have, so one retriever serves every category.cURL
category as keyword. To filter on another field, such as title, add it to payload_indexes the same way.
Rerank the top results
A cross-encoder reads the query and each chunk together and scores the pair. It ranks more precisely than vector distance and costs more time per document, so run it on the few chunks the search returned. Add arerank stage after the search:
kb-hybrid stages, with a rerank stage
document_field: textpoints the reranker at the chunk text. The stage’s default iscontent, a field these chunks do not have, and the stage leaves out every document without the field.max_candidatescaps how many incoming documents the reranker scores. At 4 CPU, 10 documents take about 8 seconds withBAAI__bge_reranker_v2_m3, so raise it with care.- The reranker writes its score to
scores.rerankon each document and keeps the besttop_k.
details.served_alternatives lists the rerankers it does serve. Rerank covers the other parameters.
Change the chunking
Chunk size trades precision for context. Small chunks point at the exact sentence and lose what surrounds it; large chunks keep context and blur the match.chunk_size and chunk_overlap count in the unit split_by names.
For Markdown sources, one chunk per heading section, with the heading path on each chunk in
heading_path:
kb-chunks feature_extractor.parameters
Next steps
Feature Search
Every search, fusion and grouping option for the stage both retrievers use.
Text extractor
Chunking, HTML pages, YouTube captions and structured extraction.
Classify documents
Tag each article against a taxonomy of reference categories.
Discover topics
Cluster chunk embeddings to find topic groups you did not define.

