{"_id":"@caleblawson/chroma","name":"@caleblawson/chroma","dist-tags":{"latest":"0.10.3"},"versions":{"0.10.3":{"name":"@caleblawson/chroma","version":"0.10.3","description":"Chroma vector store provider for Mastra","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"license":"MIT","dependencies":{"chromadb":"^2.4.6"},"devDependencies":{"@microsoft/api-extractor":"^7.52.8","@types/node":"^20.19.0","eslint":"^9.28.0","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^3.2.3","@internal/lint":"0.0.13","@mastra/core":"npm:@caleblawson/core@0.10.7-alpha.0"},"peerDependencies":{"@mastra/core":">=0.10.4-0 <0.11.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting","build:watch":"pnpm build --watch","test":"vitest run","lint":"eslint ."},"gitHead":"c31e90130a5c9765c23f688ecea70adc6164543d","_id":"@caleblawson/chroma@0.10.3","_integrity":"sha512-RVh31mNND2AXGcYSyVfT5TOTS0X0A3euVCl9cX5hr3lo50gegVJReWNaMB4SDusShSLXL9zHxhr4aCRPhSarCA==","_resolved":"C:\\Users\\caleb\\AppData\\Local\\Temp\\10c0a94d8c88c3459a76c7933380d059\\caleblawson-chroma-0.10.3.tgz","_from":"file:caleblawson-chroma-0.10.3.tgz","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-RVh31mNND2AXGcYSyVfT5TOTS0X0A3euVCl9cX5hr3lo50gegVJReWNaMB4SDusShSLXL9zHxhr4aCRPhSarCA==","shasum":"ccc7df0d5518eb10c4ffc6537d214c88cc57e050","tarball":"https://registry.npmjs.org/@caleblawson/chroma/-/chroma-0.10.3.tgz","fileCount":21,"unpackedSize":170941,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDAEQdICI7hMiU854FcAFG1qGSVbcw6oWZV4Yx3Jxju6gIhAMPoBBq3Ax9K06i/4pUzYJEA3G2ZMuq9WvyiAcBttOcB"}]},"_npmUser":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","actor":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","type":"user"}},"directories":{},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chroma_0.10.3_1750619786727_0.11134720105488549"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-22T19:16:26.632Z","0.10.3":"2025-06-22T19:16:26.889Z","modified":"2025-06-22T19:16:27.160Z"},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"description":"Chroma vector store provider for Mastra","license":"MIT","readme":"# @mastra/chroma\r\n\r\nVector store implementation for ChromaDB using the official chromadb client with added dimension validation, collection management, and document storage capabilities.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @mastra/chroma\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { ChromaVector } from '@mastra/chroma';\r\n\r\nconst vectorStore = new ChromaVector({\r\n  path: 'http://localhost:8000',  // ChromaDB server URL\r\n  auth: {                         // Optional authentication\r\n    provider: 'token',\r\n    credentials: 'your-token'\r\n  }\r\n});\r\n\r\n// Create a new collection\r\nawait vectorStore.createIndex({ indexName: 'myCollection', dimension: 1536, metric: 'cosine' });\r\n\r\n// Add vectors with documents\r\nconst vectors = [[0.1, 0.2, ...], [0.3, 0.4, ...]];\r\nconst metadata = [{ text: 'doc1' }, { text: 'doc2' }];\r\nconst documents = ['full text 1', 'full text 2'];\r\nconst ids = await vectorStore.upsert({\r\n  indexName: 'myCollection',\r\n  vectors,\r\n  metadata,\r\n  documents, // store original text\r\n});\r\n\r\n// Query vectors with document filtering\r\nconst results = await vectorStore.query({\r\n  indexName: 'myCollection',\r\n  queryVector: [0.1, 0.2, ...],\r\n  topK: 10, // topK\r\n  filter: { text: { $eq: 'doc1' } }, // metadata filter\r\n  includeVector: false, // includeVector\r\n  documentFilter: { $contains: 'specific text' } // document content filter\r\n});\r\n```\r\n\r\n## Configuration\r\n\r\nRequired:\r\n\r\n- `path`: URL of your ChromaDB server\r\n\r\nOptional:\r\n\r\n- `auth`: Authentication configuration\r\n  - `provider`: Authentication provider\r\n  - `credentials`: Authentication credentials\r\n\r\n## Features\r\n\r\n- Vector similarity search with cosine, euclidean, and dot product metrics\r\n- Document storage and retrieval\r\n- Document content filtering\r\n- Strict vector dimension validation\r\n- Collection-based organization\r\n- Metadata filtering support\r\n- Optional vector inclusion in query results\r\n- Automatic UUID generation for vectors\r\n- Built-in collection caching for performance\r\n- Built on top of chromadb client\r\n\r\n## Methods\r\n\r\n- `createIndex({ indexName, dimension, metric? })`: Create a new collection\r\n- `upsert({ indexName, vectors, metadata?, ids?, documents? })`: Add or update vectors with optional document storage\r\n- `query({ indexName, queryVector, topK?, filter?, includeVector?, documentFilter? })`: Search for similar vectors with optional document filtering\r\n- `listIndexes()`: List all collections\r\n- `describeIndex(indexName)`: Get collection statistics\r\n- `deleteIndex(indexName)`: Delete a collection\r\n\r\n## Query Response Format\r\n\r\nQuery results include:\r\n\r\n- `id`: Vector ID\r\n- `score`: Distance/similarity score\r\n- `metadata`: Associated metadata\r\n- `document`: Original document text (if stored)\r\n- `vector`: Original vector (if includeVector is true)\r\n\r\n## Related Links\r\n\r\n- [ChromaDB Documentation](https://docs.trychroma.com/)\r\n- [ChromaDB API Reference](https://docs.trychroma.com/api/client)\r\n","readmeFilename":"README.md","_rev":"1-9c5056e472c5ca910af32ec50c563ed2"}