Overview
Rig follows a modular integration strategy that separates core functionality into distinct integration types:
- Model Providers
- Vector Stores
- Plugins (Discord, Twitter, etc. - coming soon)
Model Provider Integrations
Model providers are built directly into rig-core
under the providers
module, as shown in:
//! Rig natively supports the following completion and embedding model provider integrations:
//! - OpenAI
//! - Cohere
//! - Anthropic
//! - Perplexity
//! - Gemini
//! - xAI
Each provider integration includes:
- Client implementation with API handling
- Model initialization helpers
- Request/response type definitions
- High-level abstractions (agents, RAG systems)
Example using OpenAI provider:
use rig::providers::openai;
// Initialize the client
let client = openai::Client::new("your-api-key");
// Create a model
let gpt4 = client.completion_model("gpt-4");
// Or create an agent directly
let agent = client.agent("gpt-4")
.preamble("You are a helpful assistant")
.build();
Vector Store Integrations
Vector stores are maintained as companion crates to keep the core library lean. As described in CONTRIBUTING.md:
Rig is split up into multiple crates in a monorepo structure. The main crate
rig-core
contains all of the foundational abstractions for building with LLMs. This crate avoids adding many new dependencies to keep to lean and only really contains simple provider integrations on top of the base layer of abstractions. Side crates are leveraged to help add important first-party behavior without over burdening the main library with dependencies. For example,rig-mongodb
contains extra dependencies to be able to interact withmongodb
as a vector store.If you are unsure whether a side-crate should live in the main repo, you can spin up a personal repo containing your crate and create an issue in our repo making the case on whether this side-crate should be integrated in the main repo and maintained by the Rig team.
Current vector store integrations include:
Vector stores are available as separate companion-crates:
- MongoDB vector store: [`rig-mongodb`](https://github.com/0xPlaygrounds/rig/tree/main/rig-mongodb)
- LanceDB vector store: [`rig-lancedb`](https://github.com/0xPlaygrounds/rig/tree/main/rig-lancedb)
- Neo4j vector store: [`rig-neo4j`](https://github.com/0xPlaygrounds/rig/tree/main/rig-neo4j)
- Qdrant vector store: [`rig-qdrant`](https://github.com/0xPlaygrounds/rig/tree/main/rig-qdrant)
Each vector store companion crate:
- Implements the
VectorStoreIndex
trait fromrig-core
- Manages its own dependencies
- Provides store-specific configuration options
- Contains dedicated examples and documentation
Note: In-memory vector store is included in rig-core
as a default implementation.
Upcoming Plugin Integrations
Rig is expanding to support platform-specific plugins for enhanced context retrieval and interactions:
Social Media Plugins
- Twitter Plugin: Retrieve tweet context, thread analysis, and user interactions
- Discord Plugin: Access channel history, member interactions, and server analytics
Features
- Real-time data streaming
- Context-aware responses
- Platform-specific formatting
- Rate limiting and caching
- Authentication handling
These plugins will enable:
- Building context-aware chatbots
- Social media monitoring and analysis
- Automated engagement systems
- Cross-platform content management
Contributing New Integrations
The project welcomes new integrations through pull requests. Templates are available:
## Vector Store Integration Request
<!--
Describe the vector store and the features it provides (e.g.: is it cloud only? a plugin to an existing database? document-based or relational? etc.)
-->
### Resources
<!--
Links to API docs, SDKs or any other information that would help in the integration of the new vector store.
-->
When contributing:
- For model providers: Add implementation under
rig-core/src/providers/
- For vector stores: Create a new companion crate following existing patterns
- For plugins: Use the plugin template and implement required interfaces
- Update documentation and changelog entries
For detailed contribution guidelines, see the Contributing Guide.