Skip to content

[Feature]: Vercel AI SDK Cookbook #257

@Lucifer4255

Description

@Lucifer4255

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions