Description
@moss-tools/vercel-sdk is a published package in this repo that wraps MossClient into 6 Vercel AI SDK-compatible tool definitions. However, there is no cookbook showing how to actually use it. Developers discovering Moss through the Vercel AI SDK ecosystem have no reference to follow.
Use case
A developer building a Next.js or serverless app with the Vercel AI SDK wants to add semantic search to their AI agent. They install @moss-tools/vercel-sdk, but there is no end-to-end example showing how to load an index, wire up mossSearchTool into generateText or streamText, and get grounded responses from the LLM.
Proposed solution
Add a cookbook at examples/cookbook/vercel-ai-sdk/ following the same structure as examples/cookbook/langchain/:
moss_vercel.ts — a RAG Q&A agent using streamText with mossSearchTool
prebound to an index, so the LLM automatically retrieves context before answering
package.json with minimal dependencies (@moss-tools/vercel-sdk,
@moss-dev/moss, ai, zod)
.env.example
README.md
Time to finish for me- 1 day (max)
Alternatives considered
Using the JS/TS SDK directly (@moss-dev/moss) — possible, but this bypasses @moss-tools/vercel-sdk entirely and requires developers to manually wire up tool definitions with Zod schemas. The package already does this work; the cookbook should demonstrate it, not duplicate it.
Description
@moss-tools/vercel-sdkis a published package in this repo that wraps MossClient into 6 Vercel AI SDK-compatible tool definitions. However, there is no cookbook showing how to actually use it. Developers discovering Moss through the Vercel AI SDK ecosystem have no reference to follow.Use case
A developer building a Next.js or serverless app with the Vercel AI SDK wants to add semantic search to their AI agent. They install
@moss-tools/vercel-sdk, but there is no end-to-end example showing how to load an index, wire upmossSearchToolintogenerateTextorstreamText, and get grounded responses from the LLM.Proposed solution
Add a cookbook at
examples/cookbook/vercel-ai-sdk/following the same structure asexamples/cookbook/langchain/:moss_vercel.ts— a RAG Q&A agent usingstreamTextwithmossSearchToolprebound to an index, so the LLM automatically retrieves context before answering
package.jsonwith minimal dependencies (@moss-tools/vercel-sdk,@moss-dev/moss,ai,zod).env.exampleREADME.mdTime to finish for me- 1 day (max)
Alternatives considered
Using the JS/TS SDK directly (
@moss-dev/moss) — possible, but this bypasses@moss-tools/vercel-sdkentirely and requires developers to manually wire up tool definitions with Zod schemas. The package already does this work; the cookbook should demonstrate it, not duplicate it.