> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel AI SDK integration

> Build a TypeScript knowledge-base agent with the Vercel AI SDK and Infino. Wire up tools for vector, BM25, and hybrid retrieval over your data.

Use Infino as the retrieval layer for an agent built with the
[Vercel AI SDK](https://ai-sdk.dev). Embed with the AI SDK (`embed` / `embedMany`),
index into Infino, and expose retrieval as a `tool` the model calls, so the agent
grounds its answers in your data.

```bash theme={null}
pnpm i ai zod @ai-sdk/openai @infino-ai/infino
```

The pattern:

1. **Index.** `embedMany` your chunks, then `append` them to an Infino table with an
   FTS + vector index.
2. **Retrieve.** Define a `tool` whose `execute` embeds the query and runs Infino's
   hybrid (BM25 + vector) search, returning the top passages.
3. **Generate.** Pass the tool to `generateText` with `stopWhen: stepCountIs(...)`;
   the model calls it to ground its answer.

See the [`@infino-ai/infino`](https://www.npmjs.com/package/@infino-ai/infino) package
and the [Quickstart](/quickstart) for the Node API used inside the tool.

## See also

* [Quickstart](/quickstart)
* [All integrations](/integrations)
* [LangChain](/integrations/langchain)
