
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@mastra/chroma
Advanced tools
Affected versions:
Vector store implementation for Chroma using the official chromadb client with added dimension validation, collection management, and document storage capabilities.
npm install @mastra/chroma
To run a Chroma server, use the Chroma CLI. It is available to you when you install this package.
chroma run
You will now have a Chroma server running on localhost:8000.
import { ChromaVector } from '@mastra/chroma';
const vectorStore = new ChromaVector();
If you run a Chroma server locally with a different configuration, or deploy a Chroma server yourself, you can configure your ChromaVector instantiation with specific connection details:
import { ChromaVector } from '@mastra/chroma';
const vectorStore = new ChromaVector({
host: 'your-host-address',
port: 8000,
ssl: false,
headers: {}, // any HTTP headers to send,
});
Provide your Chroma Cloud API key, tenant, and database.
You can use the Chroma CLI to set these as environment variables: chroma db connect [DB-NAME] --env-file.
import { ChromaVector } from '@mastra/chroma';
const vectorStore = new ChromaVector({
apiKey: process.env.CHROMA_API_KEY,
tenant: process.env.CHROMA_TENANT,
database: process.env.CHROMA_DATABASE,
});
// 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
});
createIndex({ 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 filteringupdateVector({ indexName, id?, filter?, update }): Update a single vector by ID or metadata filterdeleteVector({ indexName, id }): Delete a single vector by IDdeleteVectors({ indexName, ids?, filter? }): Delete multiple vectors by IDs or metadata filterlistIndexes(): 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
The npm package @mastra/chroma receives a total of 4,928 weekly downloads. As such, @mastra/chroma popularity was classified as popular.
We found that @mastra/chroma demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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 now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.