Research preview
Overview
SID-2 is an agentic retrieval model. It searches your data and returns ranked IDs for the documents needed to answer a question.
Static vs agentic retrieval
A static retrieval pipeline runs a fixed sequence of steps and returns whatever it found, even when that is wrong. It cannot react to what it sees. In practice, static pipelines accumulate a long tail of failures on tasks like multi-step or multi-hop questions.


SID-2 searches, reads the results, adapts, and searches again until it has enough. If a question is easy and the results are found quickly, it can choose to end early. If the question is hard, it can make more searches until it finds the right results or exhausts its turns. This complete search task is an episode.


You own your data and the code around the model. You implement the search tools that run against your backend, format the results, and run the loop. Using SID-2 doesn't require you to reindex your data or store it somewhere else. It only sees the results your tools return.
What is an episode?
An episode is one complete search task for your question, from the initial question until SID-2 reports the relevant IDs or the run ends. Within that one task, the agent can make many individual keyword searches, vector searches, and read calls across multiple turns. A turn is one response from the model and can contain several tool calls.
Documents, chunks, and snippets
We use document (or doc) and chunk interchangeably: one indexed record with its own ID. That record may be a complete source document or a chunk taken from a larger document, as in a vector search index.
A snippet is a short, query-relevant excerpt from that record, usually much shorter than a chunk in a vector search index. Search tools show snippets so the model can judge relevance without reading every chunk in full. A short chunk may fit entirely in its snippet.
A read call usually returns the full chunk, or a requested character range within it. Reading the full chunk does not necessarily mean reading the entire original source document.
Implementing the agent loop
Start with Installation to install the SDK and create a SID API key.
You implement the search tools and orchestration of requests to SID-2. The model decides which searches to make, what filters to set, and how many times to iterate.
Quickstart: using the reference implementation
For simple use cases with a single corpus with a keyword search and vector search tool, you can build from the reference implementation. vector_search and keyword_search (vectorSearch and keywordSearch in TypeScript and Go) are left unimplemented. Plug them into your own store:
SID_API_KEY=your-api-key uv run --with sid-sdk --with openai reference_implementation.pypip install sid-sdk openai
SID_API_KEY=your-api-key python reference_implementation.pynpm install @sid-ai/sid-sdk openai
npm install --save-dev tsx
SID_API_KEY=your-api-key npx tsx reference_implementation.tsgo mod init sid-example
go get github.com/sidhq/sid-go github.com/openai/openai-go/v3
SID_API_KEY=your-api-key go run reference_implementation.goBASETEN_API_KEY=your-api-key uv run --with sid-sdk --with openai reference_implementation_baseten.pypip install sid-sdk openai
BASETEN_API_KEY=your-api-key python reference_implementation_baseten.pynpm install @sid-ai/sid-sdk openai
npm install --save-dev tsx
BASETEN_API_KEY=your-api-key npx tsx reference_implementation_baseten.tsgo mod init sid-example
go get github.com/sidhq/sid-go github.com/openai/openai-go/v3
BASETEN_API_KEY=your-api-key go run reference_implementation_baseten.goSAGEMAKER_ENDPOINT_NAME=your-endpoint AWS_DEFAULT_REGION=your-region uv run --with sid-sdk --with openai --with "responses-sagemaker @ git+https://github.com/sidhq/responses-sagemaker" reference_implementation_sagemaker.pypip install sid-sdk openai git+https://github.com/sidhq/responses-sagemaker
SAGEMAKER_ENDPOINT_NAME=your-endpoint AWS_DEFAULT_REGION=your-region python reference_implementation_sagemaker.pyPlug your search tools and document structure into the implementation.
vector_search/keyword_search: return a list of objects with"id","content", and any extra fields (e.g."title") your tools pass toDocumentCache.add_document(addDocumentin TypeScript,AddDocumentin Go) as display attributes.INSTRUCTIONS: the system prompt.QUESTION: what you want answered.TOOL_EXAMPLES: few-shot tool calls that demonstrate using the search tools, including additional features your backend supports.
Implementing the agent loop from scratch


With more complex tool sets and multi-corpus setups, you will need to adapt more of the reference implementation's agent loop.
SID-2 is trained with the following classes of tools:
- Search tools: the model submits a query, filter set, limit and snippet size, and gets a formatted list of documents returned. Use
text_searchfor keyword search andsearchfor vector search. For multiple corpora, prepend the corpus name, for exampleemail_text_search. - Read tools: the model submits a document ID, potentially with a character range, and gets the formatted chunk referenced by this ID, in full or for that character range.
The report tool, report_helpful_ids, is fixed and cannot be changed or modified. The model submits a list of document IDs it believes to be most relevant, terminating the agent loop.