Skip to content

Conversation

@UmeshpJadhav
Copy link

@UmeshpJadhav UmeshpJadhav commented Jan 4, 2026

PR Checklist

  • The commit message follows our guidelines
  • Related issue(s) linked
  • Tests for the changes have been added
  • Docs have been added / updated
  • Changesets have been added (Skipped: Example is private)

Bugs / Features

fixes #871

What is the new behavior?

This PR introduces a new example examples/with-lancedb that demonstrates how to integrate LanceDB with VoltAgent.

Key Features:

  • Embeddable / Serverless: Uses LanceDB's local mode by default (zero-setup).
  • Configurable: Supports LANCEDB_URI environment variable for connecting to LanceDB Cloud.
  • Persistent Storage: Automatically creates and persists the vector database in .voltagent/lancedb.
  • Dual Agent Demo: Includes both an "Assistant with Retriever" (automatic context injection) and "Assistant with Tools" (agent-decided retrieval) pattern.
  • Robust Setup: Includes full TypeScript setup, README.md, and environment configuration.

Notes for reviewer

This example is consistent with with-pinecone and with-chroma. It uses @lancedb/lancedb for vector storage. The implementation includes logic to seed sample documents if the table does not exist.


Summary by cubic

Adds the with-lancedb example to integrate LanceDB with VoltAgent for local or cloud vector storage. Demonstrates retrieval with OpenAI embeddings and two agent patterns; fixes #871.

  • New Features
    • Embedded LanceDB by default; switch to cloud via LANCEDB_URI.
    • Persistent storage: .voltagent/lancedb (vectors) and .voltagent/memory.db (memory).
    • Retriever with OpenAI text-embedding-3-small and vector search; adds references to context.
    • Two agents: automatic retriever and tool-based retrieval.
    • Auto-seeds sample docs if the table is missing.
    • Includes README, website guide, .env.example, TypeScript setup, and Hono server (port 3000).

Written for commit 775cb76. Summary will update on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

⚠️ No Changeset found

Latest commit: 775cb76

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 7 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="examples/with-lancedb/.env.example">

<violation number="1" location="examples/with-lancedb/.env.example:1">
P2: The default `LANCEDB_URI=./data/lancedb` contradicts the README which states the database is stored in `.voltagent/lancedb`. Consider updating to `.voltagent/lancedb` for consistency with documentation.</violation>
</file>

<file name="examples/with-lancedb/README.md">

<violation number="1" location="examples/with-lancedb/README.md:17">
P2: Node.js version requirement is inconsistent with the project. The root `package.json` requires `node &gt;= 20`, but this README says `Node.js 18+`. Update to `Node.js 20+` for consistency.</violation>
</file>

<file name="examples/with-lancedb/src/retriever/index.ts">

<violation number="1" location="examples/with-lancedb/src/retriever/index.ts:92">
P2: Silent failure when all embeddings fail. If `recordsWithEmbeddings.length` is 0 (all embedding generations failed), the table is never created but no warning is logged. Consider adding an `else` branch to log a warning message so developers understand why the knowledge base isn&#39;t initialized.</violation>
</file>

<file name="examples/with-lancedb/package.json">

<violation number="1" location="examples/with-lancedb/package.json:30">
P1: Zod version ^4.3.5 is inconsistent with the rest of the project which uses ^3.25.76. Zod v4 has breaking API changes that may cause compatibility issues with VoltAgent packages.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@UmeshpJadhav UmeshpJadhav force-pushed the feat/add-lancedb-integration branch from e7c2d9d to 5c137cb Compare January 4, 2026 14:48
@UmeshpJadhav UmeshpJadhav force-pushed the feat/add-lancedb-integration branch from 5c137cb to fdd1c09 Compare January 5, 2026 04:04
@omeraplak
Copy link
Member

Hey @UmeshpJadhav , thanks a lot for the PR, really appreciate it.

Would you also have a chance to add this to the docs as well?
Here are the relevant links:

That would be amazing. Thanks again!

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 102 files (changes from recent commits).

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".changeset/chilly-windows-wink.md">

<violation number="1">
P2: Changeset content doesn&#39;t match PR description. The PR is for adding a LanceDB integration example, but the changeset describes &#39;fix: OutputSpec export&#39; for `@voltagent/core`. This will result in misleading release notes. Either update the changeset to reflect the actual changes, remove it if the example doesn&#39;t require one, or update the PR description to document the OutputSpec fix.</violation>
</file>

<file name="examples/with-cloudflare-workers/wrangler.toml">

<violation number="1">
P2: Hardcoded database ID should be a placeholder. Users need to create their own D1 database and provide their own ID. Consider using an empty string or placeholder like the `account_id` field above.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@UmeshpJadhav
Copy link
Author

@omeraplak thanks for the review.
I have added the LanceDB documentation and updated the overview page as requested

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@UmeshpJadhav UmeshpJadhav requested a review from omeraplak January 7, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] support LanceDB

2 participants