Skip to main content

Crate ares_store

Crate ares_store 

Source
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 database
  • lancedb - Serverless, embedded vector database (may have build issues on Windows)
  • qdrant - High-performance vector search engine
  • pgvector - PostgreSQL extension
  • chromadb - Simple embedding database
  • pinecone - 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§

PostgresService
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).