Skip to content

feat(vectorstores): add Chromia vectorstore integration and examples #8041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liho00
Copy link

@liho00 liho00 commented Apr 18, 2025

Add Chromia vectorstore integration

Description

Adds integration with Chromia as a new vectorstore option in LangChain.js. Chromia is a relational blockchain database that can be used for vector similarity search.

Key Features

  • Full vectorstore implementation supporting:
    • Document/vector addition
    • Similarity search
    • Document deletion
    • Filtering support (interface added but not yet implemented)
  • Built on top of postchain-client for Chromia interaction
  • Complete TypeScript types and documentation

Usage Example

import { Chromia } from '@langchain/community/vectorstores/chromia';
import { OpenAIEmbeddings } from '@langchain/openai';

const embeddings = new OpenAIEmbeddings({
  model: "text-embedding-3-small", 
});

const vectorStore = new Chromia(embeddings, {
  client: postchainClient,
  numDimensions: embeddings.dimensions,
});

// Add documents
await vectorStore.addDocuments([
  { pageContent: "sample text", metadata: { source: "doc1" } }
]);

// Search
const results = await vectorStore.similaritySearch("query", 1);

Dependencies

  • Requires postchain-client as a peer dependency

Testing

  • Added unit tests for core vectorstore operations
  • Tested with sample documents and queries
  • Verified error handling for edge cases

Documentation

  • Added comprehensive JSDoc comments
  • Included usage examples in class documentation
  • Added type definitions for all public interfaces

Todo

  • Implement filter support in similarity search
  • Add batch operations optimization
  • Add more advanced search options

Copy link

vercel bot commented Apr 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 18, 2025 6:48pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Apr 18, 2025 6:48pm

@Prem95
Copy link

Prem95 commented Apr 28, 2025

Hi @jacoblee93 Can you please help to take a look at this PR? Thank you!

@benjamincburns
Copy link
Collaborator

benjamincburns commented Apr 28, 2025

@Prem95 this is in draft status - we generally wait until it's no longer a draft to review unless you have specific questions. If you think this is ready, please click the "Ready for review" button and we'll have a look.

Edit: Oh, I see this isn't your PR - @liho00 will need to update the PR status when they're ready for us.

@Prem95
Copy link

Prem95 commented Apr 29, 2025

@Prem95 this is in draft status - we generally wait until it's no longer a draft to review unless you have specific questions. If you think this is ready, please click the "Ready for review" button and we'll have a look.

Edit: Oh, I see this isn't your PR - @liho00 will need to update the PR status when they're ready for us.

Thanks @benjamincburns for the information. It will be updated

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.

3 participants