mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #26] [MERGED] Embedding Providers Implementation #127
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/26
Author: @asdek
Created: 3/29/2025
Status: ✅ Merged
Merged: 3/29/2025
Merged by: @asdek
Base:
master← Head:21-new-embedding-providers📝 Commits (4)
dd753f4fix: update prompts to clarify memory usage for toolse919884refactor: replace terminal package imports with pkg/terminalaa230e1feat: add embedding configuration and provider integrationc33d88dfeat: add etester utility for embedding management📊 Changes
34 files changed (+1548 additions, -110 deletions)
View changed files
📝
.env.example(+7 -0)📝
.vscode/launch.json(+16 -0)📝
Dockerfile(+4 -0)📝
README.md(+133 -0)➕
backend/cmd/etester/flush.go(+42 -0)➕
backend/cmd/etester/info.go(+203 -0)➕
backend/cmd/etester/main.go(+131 -0)➕
backend/cmd/etester/reindex.go(+122 -0)➕
backend/cmd/etester/search.go(+289 -0)➕
backend/cmd/etester/test.go(+106 -0)➕
backend/cmd/etester/tester.go(+76 -0)📝
backend/cmd/ftester/main.go(+1 -1)📝
backend/cmd/ftester/mocks/logs.go(+1 -1)📝
backend/cmd/ftester/mocks/tools.go(+1 -1)📝
backend/cmd/ftester/worker/executor.go(+23 -13)📝
backend/cmd/ftester/worker/interactive.go(+1 -1)📝
backend/cmd/ftester/worker/tester.go(+2 -2)📝
backend/go.mod(+14 -2)📝
backend/go.sum(+2 -0)📝
backend/pkg/config/config.go(+8 -0)...and 14 more files
📄 Description
Description of the Change
This PR implements comprehensive support for embedding providers and introduces an
etesterutility for testing and managing embeddings. The implementation adds constructors for Cybertron, Huggingface, Bedrock, and VoyageAI embedding providers, updates the embedding configuration in various files, and provides a new command-line tool for embedding testing and management.Problem
The project lacked proper support for various embedding providers and tools for testing and debugging embedding functionality. This made it difficult to work with different embedding models and to effectively test and manage embeddings in the system.
Solution
The solution consists of two main components:
embedding.gofile with support for OpenAI, Ollama, Mistral, Jina, Hugging Face, GoogleAI, VoyageAIetesterutility with commands for testing, displaying statistics, flushing documents, and reindexing embeddingsType of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
etesterutility withgo build -o etester cmd/etester/main.go./etester testto verify embedding provider connectivity./etester infoto check embedding statistics./etester flushand./etester reindexTest Results
The embedding providers correctly initialize and connect to the respective services. The
etesterutility successfully performs all operations including testing, statistics gathering, flushing, and reindexing.Security Considerations
The implementation adds support for external embedding providers which require API keys and credentials. These are handled securely through environment variables and configuration files. No plaintext credentials are stored in the code.
Performance Impact
The new embedding providers offer various performance characteristics depending on the model and service used. Performance testing shows acceptable response times for embedding generation. The
etesterutility includes verbose output options that can help diagnose performance issues.Documentation Updates
.env.exampleupdates with embedding configuration optionsDeployment Notes
To use the new embedding providers, users need to:
etesterutilityNew environment variables:
EMBEDDING_PROVIDER: Type of embedding provider to useEMBEDDING_MODEL: Specific model for the selected providerEMBEDDING_API_KEY: API key for the embedding providerChecklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
The
etesterutility provides a flexible framework for testing and managing embeddings that can be extended with additional functionality in the future. The implementation of multiple embedding providers allows users to choose the most appropriate model for their specific use case and performance requirements.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.