Expand description
Database Clients and Vector Stores
This module provides database abstractions for:
- PostgreSQL: Relational database for conversations, users, etc.
- Vector Stores: Multi-provider vector database support
§Relational Database
The [PostgresClient] provides async access to PostgreSQL for:
- User management (registration, authentication)
- Conversation storage and retrieval
- Message history
- User memory (facts, preferences)
§Vector Store Providers
The following vector store backends are supported:
ares-vector(default) - Pure Rust embedded HNSW vector databaselancedb- Serverless, embedded vector database (may have build issues on Windows)qdrant- High-performance vector search enginepgvector- PostgreSQL extensionchromadb- Simple embedding databasepinecone- Managed cloud service
Enable providers via Cargo features:
ares = { version = "*", features = ["ares-vector", "qdrant"] }§Example
ⓘ
use ares::db::{PostgresClient, VectorStore, AresVectorStore};
// Relational database
let db = PostgresClient::new("postgres://user:pass@localhost:5432/ares").await?;
let user = db.get_user_by_id(user_id).await?;
// Vector store
let vector_store = AresVectorStore::new("./vectors").await?;
vector_store.upsert("docs", embeddings, metadata).await?;
let results = vector_store.search("docs", query_embedding, 10).await?;Re-exports§
pub use billing_config::BillingConfig;pub use billing_config::ModelPricingConfig;pub use config::default_qdrant_url;pub use config::DatabaseConfig;pub use config::QdrantConfig;pub use fleet_secrets::decrypt_api_key;pub use fleet_secrets::encrypt_api_key;pub use fleet_secrets::last_n_visible;pub use fleet_secrets::EncryptedPayload;pub use fleet_secrets::FleetSecrets;pub use fleet_secrets::FleetSecretsError;pub use fleet_secrets::MasterKey;pub use fleet_secrets::ProviderOverride;pub use vectorstore::CollectionInfo;pub use vectorstore::CollectionStats;pub use vectorstore::VectorStore;pub use vectorstore::VectorStoreProvider;
Modules§
- billing_
config - config
- fleet_
secrets - Fleet-wide, tenant-agnostic provider API key & config storage.
- vectorstore
- Vector Store Abstraction Layer
Structs§
- Postgres
Service - Cordis Service for postgres availability — runtime check replaces
#[cfg(feature = "postgres")]in handlers.
Functions§
- register_
plugins - Register this crate’s loader factories on
reg(manual fallback path).