
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@caleblawson/chroma
Advanced tools
Vector store implementation for ChromaDB using the official chromadb client with added dimension validation, collection management, and document storage capabilities.
npm install @mastra/chroma
import { ChromaVector } from '@mastra/chroma';
const vectorStore = new ChromaVector({
path: 'http://localhost:8000', // ChromaDB server URL
auth: { // Optional authentication
provider: 'token',
credentials: 'your-token'
}
});
// Create a new collection
await vectorStore.createIndex({ indexName: 'myCollection', dimension: 1536, metric: 'cosine' });
// Add vectors with documents
const vectors = [[0.1, 0.2, ...], [0.3, 0.4, ...]];
const metadata = [{ text: 'doc1' }, { text: 'doc2' }];
const documents = ['full text 1', 'full text 2'];
const ids = await vectorStore.upsert({
indexName: 'myCollection',
vectors,
metadata,
documents, // store original text
});
// Query vectors with document filtering
const results = await vectorStore.query({
indexName: 'myCollection',
queryVector: [0.1, 0.2, ...],
topK: 10, // topK
filter: { text: { $eq: 'doc1' } }, // metadata filter
includeVector: false, // includeVector
documentFilter: { $contains: 'specific text' } // document content filter
});
Required:
path: URL of your ChromaDB serverOptional:
auth: Authentication configuration
provider: Authentication providercredentials: Authentication credentialscreateIndex({ indexName, dimension, metric? }): Create a new collectionupsert({ indexName, vectors, metadata?, ids?, documents? }): Add or update vectors with optional document storagequery({ indexName, queryVector, topK?, filter?, includeVector?, documentFilter? }): Search for similar vectors with optional document filteringlistIndexes(): List all collectionsdescribeIndex(indexName): Get collection statisticsdeleteIndex(indexName): Delete a collectionQuery results include:
id: Vector IDscore: Distance/similarity scoremetadata: Associated metadatadocument: Original document text (if stored)vector: Original vector (if includeVector is true)FAQs
Chroma vector store provider for Mastra
We found that @caleblawson/chroma demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.