feat(vector-io): add OpenGauss vector database provider

Implement OpenGauss vector database integration for Llama Stack with the following features:
- Add OpenGaussVectorIOAdapter for vector storage and retrieval
- Support native vector similarity search operations
- Implement connection and query management with psycopg2
- Provide configuration template for easy setup
- Add comprehensive unit tests

The implementation allows Llama Stack users to leverage OpenGauss as an
enterprise-grade vector database for RAG applications. Users can configure
their environment through a simple YAML configuration and environment variables.
This commit is contained in:
qifengleqifengle 2025-07-14 16:50:29 +08:00
parent d880c2df0e
commit 5e9c394500
10 changed files with 854 additions and 0 deletions

View file

@ -0,0 +1,27 @@
version: 2
distribution_spec:
description: "Custom configuration using Opengauss for vector storage and metadata"
providers:
inference:
- remote::together-openai-compat
vector_io:
- remote::opengauss
agents:
- inline::meta-reference
tool_runtime:
- inline::rag-runtime
files:
- inline::localfs
telemetry:
- inline::meta-reference
safety:
- inline::llama-guard
image_type: venv
additional_pip_packages:
- psycopg2-binary>=2.9.3
- pgvector>=0.2.0
- asyncpg>=0.27.0
# rm -rf ~/.llama/distributions/opengauss-demo
# uv run --with llama-stack llama stack build --template opengauss-demo --image-type venv
# uv run --env-file .env --with llama-stack llama stack run /home/gt/.llama/distributions/opengauss-demo/opengauss-demo-run.yaml