Add Vercel AI SDK cookbook (closes #257) - #373
Merged
HarshaNalluru merged 16 commits intoJul 15, 2026
Merged
Conversation
This file defines the project metadata, dependencies, and scripts for the Vercel AI SDK example.
Added a README for the Vercel AI SDK Cookbook demonstrating how to integrate Moss semantic search.
This file contains sample support document snippets for demo purposes.
This script initializes a Moss index using environment variables and sample documents.
Updated README to clarify usage and prerequisites for Vercel AI SDK example.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new TypeScript cookbook under examples/cookbook/vercel-ai-sdk/ demonstrating how to use the repo’s @moss-tools/vercel-sdk tools with the Vercel AI SDK (generateText / streamText), and updates the root README to reference it.
Changes:
- Add a new
vercel-ai-sdkcookbook with a seeding script, CLI Q&A script, and environment template. - Document setup and usage in a new cookbook README.
- Update the root README integration link + examples tree to include the new cookbook.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds the cookbook to the examples tree + points the Vercel AI SDK integration link to the new cookbook. |
| examples/cookbook/vercel-ai-sdk/README.md | New cookbook documentation (currently has Markdown rendering issues per comments). |
| examples/cookbook/vercel-ai-sdk/package.json | Defines minimal dependencies and seed/start scripts for the cookbook. |
| examples/cookbook/vercel-ai-sdk/.env.example | Example env vars for Moss + OpenAI configuration. |
| examples/cookbook/vercel-ai-sdk/seed_data.ts | Provides small sample documents for end-to-end seeding. |
| examples/cookbook/vercel-ai-sdk/create_index.ts | Seeds an index (needs to delete existing index first to be rerunnable). |
| examples/cookbook/vercel-ai-sdk/moss_vercel.ts | CLI example that wires mossSearchTool into generateText/streamText (needs formatting fixes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…potency Applies all 10 suggested fixes from the Copilot code review: - Fix indentation in moss_vercel.ts, create_index.ts, and seed_data.ts - Make create_index.ts idempotent by deleting an existing index before recreating it - Fix broken Markdown list nesting in the cookbook README - Fix cookbook tree indentation in the root README Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Removed the local requireEnv function and imported it from utils.js.
The previously pinned ^1.0.0 was stale and incompatible with ai ^7.0.0. Verified on npm that @ai-sdk/openai 4.0.11 (latest) is the version aligned with the ai v7 major.
Contributor
|
@HarshaNalluru go ahead with the merge, I have reviewed it |
HarshaNalluru
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #257
Adds a new cookbook at
examples/cookbook/vercel-ai-sdk/showing how to use@moss-tools/vercel-sdkwith the Vercel AI SDK, following the same layout as the existingexamples/cookbook/langchain/cookbook.What's included
moss_vercel.ts- a small CLI example that prebindsmossSearchToolto an index and answers questions withgenerateText, with an optionalstreamTextmodepackage.json- minimal dependencies (@moss-tools/vercel-sdk,@moss-dev/moss,ai,@ai-sdk/openai,zod,dotenv).env.example- placeholder environment variables, no real credentialsREADME.md- setup and usage instructionsTesting
This is a documentation/example addition. Verified the example code against the published
@moss-tools/vercel-sdkAPI (mossSearchTool({ client, indexName })) as documented inpackages/vercel-sdk.