From 7ea5cbe54a42bbf275acaffdcc217516f2ec4442 Mon Sep 17 00:00:00 2001 From: Christophe Date: Thu, 7 Nov 2024 13:50:53 -0500 Subject: [PATCH] docs: Improve main lib docs --- rig-core/src/lib.rs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/rig-core/src/lib.rs b/rig-core/src/lib.rs index 9c5da653..eccd155e 100644 --- a/rig-core/src/lib.rs +++ b/rig-core/src/lib.rs @@ -1,7 +1,6 @@ //! Rig is a Rust library for building LLM-powered applications that focuses on ergonomics and modularity. //! //! # Table of contents -//! //! - [High-level features](#high-level-features) //! - [Simple Example](#simple-example) //! - [Core Concepts](#core-concepts) @@ -18,7 +17,7 @@ //! //! #[tokio::main] //! async fn main() { -//! // Create OpenAI client and model. +//! // Create OpenAI client and agent. //! // This requires the `OPENAI_API_KEY` environment variable to be set. //! let openai_client = openai::Client::from_env(); //! @@ -39,35 +38,45 @@ //! # Core concepts //! ## Completion and embedding models //! Rig provides a consistent API for working with LLMs and embeddings. Specifically, -//! each provider (e.g. OpenAI, Cohere) has a `Client` struct that can be used to create completion +//! each provider (e.g. OpenAI, Cohere) has a `Client` struct that can be used to initialize completion //! and embedding models. These models implement the [CompletionModel](crate::completion::CompletionModel) //! and [EmbeddingModel](crate::embeddings::EmbeddingModel) traits respectively, which provide a common, //! low-level interface for creating completion and embedding requests and executing them. //! //! ## Agents -//! Rig provides high-level abstractions over LLMs in the form of the [Agent](crate::agent::Agent) type. +//! Rig also provides high-level abstractions over LLMs in the form of the [Agent](crate::agent::Agent) type. //! //! The [Agent](crate::agent::Agent) type can be used to create anything from simple agents that use vanilla models to full blown //! RAG systems that can be used to answer questions using a knowledge base. //! //! ## Vector stores and indexes -//! Rig provides a common interface for working with vector stores and indexes. Specifically, the library +//! Rig defines a common interface for working with vector stores and indexes. Specifically, the library //! provides the [VectorStore](crate::vector_store::VectorStore) and [VectorStoreIndex](crate::vector_store::VectorStoreIndex) -//! traits, which can be implemented to define vector stores and indices respectively. -//! Those can then be used as the knowledgebase for a RAG enabled [Agent](crate::agent::Agent), or +//! traits, which can be implemented on a given type to define vector stores and indices respectively. +//! Those can then be used as the knowledge base for a RAG enabled [Agent](crate::agent::Agent), or //! as a source of context documents in a custom architecture that use multiple LLMs or agents. //! //! # Integrations -//! Rig natively supports the following completion and embedding model providers: +//! ## Model Providers +//! Rig natively supports the following completion and embedding model provider integrations: //! - OpenAI //! - Cohere //! - Anthropic //! - Perplexity +//! - Gemini +//! +//! You can also implement your own model provider integration by defining types that +//! implement the [CompletionModel](crate::completion::CompletionModel) and [EmbeddingModel](crate::embeddings::EmbeddingModel) traits. //! -//! Rig currently has the following integration companion crates: +//! ## Vector Stores +//! Rig currently supports the following vector store integrations via companion crates: //! - `rig-mongodb`: Vector store implementation for MongoDB //! - `rig-lancedb`: Vector store implementation for LanceDB //! - `rig-neo4j`: Vector store implementation for Neo4j +//! - `rig-qdrant`: Vector store implementation for Qdrant +//! +//! You can also implement your own vector store integration by defining types that +//! implement the [VectorStoreIndex](crate::vector_store::VectorStoreIndex) trait. pub mod agent; pub mod cli_chatbot;