-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: implement local vector store and embedding capabilities #5685
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
Conversation
- Add LibSQLVectorStore implementation using @mastra/libsql for local SQLite-based vector storage - Add FastEmbedEmbedder implementation using @mastra/fastembed for local CPU-based embeddings - Support bge-small-en-v1.5 and bge-base-en-v1.5 embedding models - Update configuration system to support "local" vector store type and "fastembed" embedder provider - Add comprehensive test coverage for new implementations - Maintain backward compatibility with existing Qdrant and OpenAI integrations - Enable zero-cost, privacy-focused code indexing without external dependencies Resolves #5682
|
✅ No security or compliance issues detected. Reviewed everything up to b2e8141. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
| this.codebaseIndexEnabled = codebaseIndexEnabled ?? true | ||
| this.qdrantUrl = codebaseIndexQdrantUrl | ||
| this.qdrantApiKey = qdrantApiKey ?? "" | ||
| this.vectorStoreType = codebaseIndexVectorStoreType as "qdrant" | "local" | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config manager now reads new fields for vectorStoreType and localVectorStorePath. Consider validating that when vectorStoreType is 'local', a valid localVectorStorePath is provided or a sensible default is applied.
| score: 0.95, | ||
| metadata: { | ||
| filePath: "/test/file1.ts", | ||
| codeChunk: "test content 1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical note: In the test for filtering results by minimum score, the first mocked result uses the property name 'codeChunk' instead of 'content' which is used in other tests. Please verify if this is an intentional variation or a typo that should be corrected for consistency.
| codeChunk: "test content 1", | |
| content: "test content 1", |
|
Automatically closed: PR created by @roomote-agent before 2025-07-16 |
|
I acknowledge the automatic closure. I will review the implementation and reopen this PR with any necessary updates to complete the local vector store and embedding capabilities feature. |
- Fix i18n path issue in setup.ts (was looking for i18n/i18n/locales instead of locales) - Fix LibSQL vector store constructor parameters in service factory - Fix FastEmbed implementation to handle empty input arrays properly - Update test files to match actual implementation signatures - Fix LibSQL vector store test parameter order and mocking
|
Automatically closed: PR created before 2025-07-16 |
|
I acknowledge the automatic closure and will review the implementation to complete the local vector store and embedding capabilities feature. Let me check the current state and reopen with any necessary updates. |
✅ Implementation Review CompleteI have successfully reviewed and updated the local vector store and embedding capabilities implementation. Here is a comprehensive summary: 🔧 Changes Made
🧪 Test Status
🚀 Key Features Confirmed
📦 Dependencies
🎯 Implementation Quality
The implementation successfully delivers on the promise of zero-cost, privacy-focused code indexing without external dependencies. The PR is ready for final review and merge. |
This PR implements local vector store and embedding capabilities to address issue #5682, enabling zero-cost, privacy-focused code indexing without external dependencies.
🚀 Features
Local Vector Store (LibSQL)
@mastra/libsqlfor local SQLite-based vector storageLocal Embeddings (FastEmbed)
@mastra/fastembedbge-small-en-v1.5(384 dimensions) andbge-base-en-v1.5(768 dimensions)🔧 Configuration
New Configuration Options
"local"option alongside existing"qdrant""fastembed"option alongside existing"openai"Backward Compatibility
🏗️ Architecture
Clean Interface Design
IVectorStoreandIEmbedderinterfacesDependencies
@mastra/libsql: Local SQLite vector database with similarity search@mastra/fastembed: Local CPU-based embedding models🧪 Testing
🎯 Benefits
Privacy & Security
Cost Efficiency
Reliability
🔗 Resolves
Closes #5682
📋 Checklist
Important
This PR adds local vector store and embedding capabilities using LibSQL and FastEmbed, with new configuration options and comprehensive testing.
LibSQLVectorStorefor local SQLite-based vector storage with cosine similarity search inlibsql-vector-store.ts.FastEmbedEmbedderfor local CPU-based embedding generation infastembed.ts.bge-small-en-v1.5andbge-base-en-v1.5.Vector Store Typeand "fastembed" forEmbedder Provider.fastembed.spec.tsandlibsql-vector-store.spec.ts.package.jsonto include@mastra/fastembedand@mastra/libsqldependencies.embeddingModels.tsto include FastEmbed model profiles.This description was created by
for b2e8141. You can customize this summary. It will automatically update as commits are pushed.