├── rig-core
├── .gitignore
├── tests
│ └── data
│ │ ├── dummy.pdf
│ │ └── pages.pdf
├── examples
│ ├── loaders.rs
│ ├── simple_model.rs
│ ├── agent.rs
│ ├── xai_embeddings.rs
│ ├── gemini_embeddings.rs
│ ├── agent_with_ollama.rs
│ ├── anthropic_agent.rs
│ ├── sentiment_classifier.rs
│ ├── perplexity_agent.rs
│ ├── extractor.rs
│ ├── agent_with_loaders.rs
│ ├── agent_with_context.rs
│ ├── gemini_agent.rs
│ ├── cohere_connector.rs
│ ├── multi_agent.rs
│ ├── vector_search_cohere.rs
│ ├── vector_search.rs
│ ├── agent_with_tools.rs
│ ├── debate.rs
│ ├── rag.rs
│ └── rag_dynamic_tools.rs
├── src
│ ├── providers
│ │ ├── xai
│ │ │ ├── mod.rs
│ │ │ └── embedding.rs
│ │ ├── anthropic
│ │ │ ├── mod.rs
│ │ │ └── client.rs
│ │ ├── mod.rs
│ │ └── gemini
│ │ │ └── mod.rs
│ ├── embeddings
│ │ ├── mod.rs
│ │ ├── embedding.rs
│ │ └── tool.rs
│ ├── json_utils.rs
│ ├── loaders
│ │ └── mod.rs
│ ├── cli_chatbot.rs
│ ├── vector_store
│ │ └── mod.rs
│ ├── lib.rs
│ └── extractor.rs
├── rig-core-derive
│ ├── Cargo.toml
│ └── src
│ │ ├── lib.rs
│ │ ├── basic.rs
│ │ ├── embed.rs
│ │ └── custom.rs
├── LICENSE
├── Cargo.toml
├── README.md
└── CHANGELOG.md
├── .gitignore
├── Cargo.toml
├── rig-qdrant
├── README.md
├── Cargo.toml
├── CHANGELOG.md
├── LICENSE
├── examples
│ └── qdrant_vector_search.rs
├── tests
│ └── integration_tests.rs
└── src
│ └── lib.rs
├── .github
├── ISSUE_TEMPLATE
│ ├── new-model-provider.md
│ ├── vector-store-integration-request.md
│ ├── bug-report.md
│ └── feature-or-improvement-request.md
├── workflows
│ ├── cd.yaml
│ └── ci.yaml
└── PULL_REQUEST_TEMPLATE
│ ├── new-model-provider.md
│ ├── other.md
│ └── new-vector-store.md
├── rig-sqlite
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── README.md
└── examples
│ └── vector_search_sqlite.rs
├── .pre-commit-config.yaml
├── rig-lancedb
├── Cargo.toml
├── LICENSE
├── README.md
├── examples
│ ├── vector_search_local_enn.rs
│ ├── vector_search_local_ann.rs
│ ├── fixtures
│ │ └── lib.rs
│ └── vector_search_s3_ann.rs
├── CHANGELOG.md
├── tests
│ ├── fixtures
│ │ └── lib.rs
│ └── integration_tests.rs
└── src
│ └── utils
│ └── mod.rs
├── rig-mongodb
├── Cargo.toml
├── LICENSE
├── README.md
├── CHANGELOG.md
└── examples
│ └── vector_search_mongodb.rs
├── rig-neo4j
├── Cargo.toml
├── LICENSE
├── CHANGELOG.md
├── examples
│ ├── display
│ │ └── lib.rs
│ ├── vector_search_movies_consume.rs
│ └── vector_search_simple.rs
├── README.md
└── tests
│ └── integration_tests.rs
├── LICENSE
├── CONTRIBUTING.md
└── img
├── rig_logo.svg
└── rig_logo_dark.svg
/rig-core/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | *.log
3 | .env
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 | target/
3 | .DS_Store
4 | .idea/
5 | .vscode/
6 |
--------------------------------------------------------------------------------
/rig-core/tests/data/dummy.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chalingok/rig/HEAD/rig-core/tests/data/dummy.pdf
--------------------------------------------------------------------------------
/rig-core/tests/data/pages.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Chalingok/rig/HEAD/rig-core/tests/data/pages.pdf
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | resolver = "2"
3 | members = [
4 | "rig-core", "rig-lancedb",
5 | "rig-mongodb", "rig-neo4j",
6 | "rig-qdrant", "rig-core/rig-core-derive",
7 | "rig-sqlite"
8 | ]
9 |
--------------------------------------------------------------------------------
/rig-qdrant/README.md:
--------------------------------------------------------------------------------
1 | # Rig-Qdrant
2 | Vector store index integration for [Qdrant](https://qdrant.tech/). This integration supports dense vector retrieval using Rig's embedding providers. It is also extensible to allow all [hybrid queries](https://qdrant.tech/documentation/concepts/hybrid-queries/) supported by Qdrant.
3 |
4 | You can find end-to-end examples [here](https://github.com/0xPlaygrounds/rig/tree/main/rig-qdrant/examples).
5 |
--------------------------------------------------------------------------------
/rig-core/examples/loaders.rs:
--------------------------------------------------------------------------------
1 | use rig::loaders::FileLoader;
2 |
3 | #[tokio::main]
4 | async fn main() -> Result<(), anyhow::Error> {
5 | FileLoader::with_glob("cargo.toml")?
6 | .read()
7 | .into_iter()
8 | .for_each(|result| match result {
9 | Ok(content) => println!("{}", content),
10 | Err(e) => eprintln!("Error reading file: {}", e),
11 | });
12 |
13 | Ok(())
14 | }
15 |
--------------------------------------------------------------------------------
/rig-core/src/providers/xai/mod.rs:
--------------------------------------------------------------------------------
1 | //! xAi API client and Rig integration
2 | //!
3 | //! # Example
4 | //! ```
5 | //! use rig::providers::xai;
6 | //!
7 | //! let client = xai::Client::new("YOUR_API_KEY");
8 | //!
9 | //! let groq_embedding_model = client.embedding_model(xai::v1);
10 | //! ```
11 |
12 | pub mod client;
13 | pub mod completion;
14 | pub mod embedding;
15 |
16 | pub use client::Client;
17 | pub use completion::GROK_BETA;
18 | pub use embedding::EMBEDDING_V1;
19 |
--------------------------------------------------------------------------------
/rig-core/rig-core-derive/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-derive"
3 | version = "0.1.0"
4 | edition = "2021"
5 | license = "MIT"
6 | description = "Internal crate that implements Rig derive macros."
7 | repository = "https://github.com/0xPlaygrounds/rig"
8 |
9 | [dependencies]
10 | indoc = "2.0.5"
11 | proc-macro2 = { version = "1.0.87", features = ["proc-macro"] }
12 | quote = "1.0.37"
13 | syn = { version = "2.0.79", features = ["full"]}
14 |
15 | [lib]
16 | proc-macro = true
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new-model-provider.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: New model provider
3 | about: Suggest a new model provider to integrate
4 | title: 'feat: Add support for X'
5 | labels: feat, model
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Model Provider Integration Request
11 |
14 |
15 | ### Resources
16 |
19 |
--------------------------------------------------------------------------------
/rig-core/examples/simple_model.rs:
--------------------------------------------------------------------------------
1 | use rig::{completion::Prompt, providers::openai};
2 |
3 | #[tokio::main]
4 | async fn main() {
5 | // Create OpenAI client and model
6 | let openai_client = openai::Client::from_env();
7 |
8 | let gpt4 = openai_client.agent("gpt-4").build();
9 |
10 | // Prompt the model and print its response
11 | let response = gpt4
12 | .prompt("Who are you?")
13 | .await
14 | .expect("Failed to prompt GPT-4");
15 |
16 | println!("GPT-4: {response}");
17 | }
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/vector-store-integration-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Vector store integration request
3 | about: Suggest a new vector store to integrate
4 | title: 'feat: Add support for X vector store'
5 | labels: data store, feat
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Vector Store Integration Request
11 |
14 |
15 | ### Resources
16 |
19 |
--------------------------------------------------------------------------------
/rig-core/src/providers/anthropic/mod.rs:
--------------------------------------------------------------------------------
1 | //! Anthropic API client and Rig integration
2 | //!
3 | //! # Example
4 | //! ```
5 | //! use rig::providers::anthropic;
6 | //!
7 | //! let client = anthropic::Anthropic::new("YOUR_API_KEY");
8 | //!
9 | //! let sonnet = client.completion_model(anthropic::CLAUDE_3_5_SONNET);
10 | //! ```
11 |
12 | pub mod client;
13 | pub mod completion;
14 |
15 | pub use client::{Client, ClientBuilder};
16 | pub use completion::{
17 | ANTHROPIC_VERSION_2023_01_01, ANTHROPIC_VERSION_2023_06_01, ANTHROPIC_VERSION_LATEST,
18 | CLAUDE_3_5_SONNET, CLAUDE_3_HAIKU, CLAUDE_3_OPUS, CLAUDE_3_SONNET,
19 | };
20 |
--------------------------------------------------------------------------------
/rig-core/src/embeddings/mod.rs:
--------------------------------------------------------------------------------
1 | //! This module provides functionality for working with embeddings.
2 | //! Embeddings are numerical representations of documents or other objects, typically used in
3 | //! natural language processing (NLP) tasks such as text classification, information retrieval,
4 | //! and document similarity.
5 |
6 | pub mod builder;
7 | pub mod embed;
8 | pub mod embedding;
9 | pub mod tool;
10 |
11 | pub mod distance;
12 | pub use builder::EmbeddingsBuilder;
13 | pub use embed::{to_texts, Embed, EmbedError, TextEmbedder};
14 | pub use embedding::{Embedding, EmbeddingError, EmbeddingModel};
15 | pub use tool::ToolSchema;
16 |
--------------------------------------------------------------------------------
/rig-sqlite/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [Unreleased]
9 |
10 | ## [0.1.0](https://github.com/0xPlaygrounds/rig/releases/tag/rig-sqlite-v0.1.0) - 2024-12-03
11 |
12 | ### Added
13 |
14 | - Add support for Sqlite vector store ([#122](https://github.com/0xPlaygrounds/rig/pull/122))
15 |
16 | ### Fixed
17 |
18 | - rig-sqlite missing version in Cargo.toml ([#137](https://github.com/0xPlaygrounds/rig/pull/137))
19 | - *(rig-sqlite)* Fix missing rig-core version
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: 'bug:
'
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | - [ ] I have looked for existing issues (including closed) about this
11 |
12 | ## Bug Report
13 |
16 |
17 | ## Reproduction
18 |
21 |
22 | ## Expected behavior
23 |
26 |
27 | ## Screenshots
28 |
31 |
32 | ## Additional context
33 |
36 |
--------------------------------------------------------------------------------
/rig-core/src/json_utils.rs:
--------------------------------------------------------------------------------
1 | pub fn merge(a: serde_json::Value, b: serde_json::Value) -> serde_json::Value {
2 | match (a, b) {
3 | (serde_json::Value::Object(mut a_map), serde_json::Value::Object(b_map)) => {
4 | b_map.into_iter().for_each(|(key, value)| {
5 | a_map.insert(key, value);
6 | });
7 | serde_json::Value::Object(a_map)
8 | }
9 | (a, _) => a,
10 | }
11 | }
12 |
13 | pub fn merge_inplace(a: &mut serde_json::Value, b: serde_json::Value) {
14 | if let (serde_json::Value::Object(a_map), serde_json::Value::Object(b_map)) = (a, b) {
15 | b_map.into_iter().for_each(|(key, value)| {
16 | a_map.insert(key, value);
17 | });
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/rig-core/rig-core-derive/src/lib.rs:
--------------------------------------------------------------------------------
1 | extern crate proc_macro;
2 | use proc_macro::TokenStream;
3 | use syn::{parse_macro_input, DeriveInput};
4 |
5 | mod basic;
6 | mod custom;
7 | mod embed;
8 |
9 | pub(crate) const EMBED: &str = "embed";
10 |
11 | /// References:
12 | ///
13 | ///
14 | #[proc_macro_derive(Embed, attributes(embed))]
15 | pub fn derive_embedding_trait(item: TokenStream) -> TokenStream {
16 | let mut input = parse_macro_input!(item as DeriveInput);
17 |
18 | embed::expand_derive_embedding(&mut input)
19 | .unwrap_or_else(syn::Error::into_compile_error)
20 | .into()
21 | }
22 |
--------------------------------------------------------------------------------
/rig-core/examples/agent.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 |
3 | use rig::{completion::Prompt, providers};
4 |
5 | #[tokio::main]
6 | async fn main() -> Result<(), anyhow::Error> {
7 | // Create OpenAI client
8 | let client = providers::openai::Client::new(
9 | &env::var("OPENAI_API_KEY").expect("OPENAI_API_KEY not set"),
10 | );
11 |
12 | // Create agent with a single context prompt
13 | let comedian_agent = client
14 | .agent("gpt-4o")
15 | .preamble("You are a comedian here to entertain the user using humour and jokes.")
16 | .build();
17 |
18 | // Prompt the agent and print the response
19 | let response = comedian_agent.prompt("Entertain me!").await?;
20 | println!("{}", response);
21 |
22 | Ok(())
23 | }
24 |
--------------------------------------------------------------------------------
/rig-qdrant/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-qdrant"
3 | version = "0.1.3"
4 | edition = "2021"
5 | license = "MIT"
6 | readme = "README.md"
7 | description = "Rig vector store index integration for Qdrant. https://qdrant.tech"
8 | repository = "https://github.com/0xPlaygrounds/rig"
9 |
10 | [dependencies]
11 | rig-core = { path = "../rig-core", version = "0.5.0" }
12 | serde_json = "1.0.128"
13 | serde = "1.0.210"
14 | qdrant-client = "1.12.1"
15 |
16 | [dev-dependencies]
17 | tokio = { version = "1.40.0", features = ["rt-multi-thread"] }
18 | anyhow = "1.0.89"
19 | testcontainers = "0.23.1"
20 |
21 | [[example]]
22 | name = "qdrant_vector_search"
23 | required-features = ["rig-core/derive"]
24 |
25 |
26 | [[test]]
27 | name = "integration_tests"
28 | required-features = ["rig-core/derive"]
29 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # See https://pre-commit.com for more information
2 | # See https://pre-commit.com/hooks.html for more hooks
3 | repos:
4 | - repo: https://github.com/pre-commit/pre-commit-hooks
5 | rev: v4.6.0
6 | hooks:
7 | - id: trailing-whitespace
8 | - id: end-of-file-fixer
9 | - id: check-yaml
10 | - id: check-added-large-files
11 | - id: check-json
12 | - id: check-case-conflict
13 | - id: check-merge-conflict
14 |
15 |
16 | - repo: https://github.com/doublify/pre-commit-rust
17 | rev: v1.0
18 | hooks:
19 | - id: fmt
20 | - id: cargo-check
21 | - id: clippy
22 |
23 | - repo: https://github.com/commitizen-tools/commitizen
24 | rev: v2.20.0
25 | hooks:
26 | - id: commitizen
27 | stages: [commit-msg]
28 |
--------------------------------------------------------------------------------
/rig-core/examples/xai_embeddings.rs:
--------------------------------------------------------------------------------
1 | use rig::providers::xai;
2 | use rig::Embed;
3 |
4 | #[derive(Embed, Debug)]
5 | struct Greetings {
6 | #[embed]
7 | message: String,
8 | }
9 |
10 | #[tokio::main]
11 | async fn main() -> Result<(), anyhow::Error> {
12 | // Initialize the xAI client
13 | let client = xai::Client::from_env();
14 |
15 | let embeddings = client
16 | .embeddings(xai::embedding::EMBEDDING_V1)
17 | .document(Greetings {
18 | message: "Hello, world!".to_string(),
19 | })?
20 | .document(Greetings {
21 | message: "Goodbye, world!".to_string(),
22 | })?
23 | .build()
24 | .await
25 | .expect("Failed to embed documents");
26 |
27 | println!("{:?}", embeddings);
28 |
29 | Ok(())
30 | }
31 |
--------------------------------------------------------------------------------
/rig-core/examples/gemini_embeddings.rs:
--------------------------------------------------------------------------------
1 | use rig::providers::gemini;
2 | use rig::Embed;
3 |
4 | #[derive(Embed, Debug)]
5 | struct Greetings {
6 | #[embed]
7 | message: String,
8 | }
9 |
10 | #[tokio::main]
11 | async fn main() -> Result<(), anyhow::Error> {
12 | // Initialize the Google Gemini client
13 | // Create OpenAI client
14 | let client = gemini::Client::from_env();
15 |
16 | let embeddings = client
17 | .embeddings(gemini::embedding::EMBEDDING_001)
18 | .document(Greetings {
19 | message: "Hello, world!".to_string(),
20 | })?
21 | .document(Greetings {
22 | message: "Goodbye, world!".to_string(),
23 | })?
24 | .build()
25 | .await
26 | .expect("Failed to embed documents");
27 |
28 | println!("{:?}", embeddings);
29 |
30 | Ok(())
31 | }
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-or-improvement-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature or improvement request
3 | about: Suggest an idea for this project
4 | title: 'feat: '
5 | labels: feat
6 | assignees: ''
7 |
8 | ---
9 |
10 | - [ ] I have looked for existing issues (including closed) about this
11 |
12 | ## Feature Request
13 |
16 |
17 | ### Motivation
18 |
21 |
22 | ### Proposal
23 |
27 |
28 | ### Alternatives
29 |
34 |
--------------------------------------------------------------------------------
/rig-sqlite/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-sqlite"
3 | version = "0.1.0"
4 | edition = "2021"
5 | description = "SQLite-based vector store implementation for the rig framework"
6 | license = "MIT"
7 |
8 | [lib]
9 | doctest = false
10 |
11 | [dependencies]
12 | rig-core = { path = "../rig-core", version = "0.5.0", features = ["derive"] }
13 | rusqlite = { version = "0.32", features = ["bundled"] }
14 | serde = { version = "1.0", features = ["derive"] }
15 | serde_json = "1.0"
16 | sqlite-vec = "0.1"
17 | tokio-rusqlite = { git = "https://github.com/programatik29/tokio-rusqlite", version = "0.6.0", features = [
18 | "bundled",
19 | ] }
20 | tracing = "0.1"
21 | zerocopy = "0.8.10"
22 | chrono = "0.4"
23 |
24 | [dev-dependencies]
25 | anyhow = "1.0.86"
26 | tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
27 | tracing-subscriber = { version = "0.3", features = ["env-filter"] }
28 |
--------------------------------------------------------------------------------
/rig-core/examples/agent_with_ollama.rs:
--------------------------------------------------------------------------------
1 | /// This example requires that you have the [`ollama`](https://ollama.com) server running locally.
2 | use rig::{completion::Prompt, providers};
3 |
4 | #[tokio::main]
5 | async fn main() -> Result<(), anyhow::Error> {
6 | // Create an OpenAI client with a custom base url, a local ollama endpoint
7 | // The API Key is unnecessary for most local endpoints
8 | let client = providers::openai::Client::from_url("ollama", "http://localhost:11434");
9 |
10 | // Create agent with a single context prompt
11 | let comedian_agent = client
12 | .agent("llama3.2:latest")
13 | .preamble("You are a comedian here to entertain the user using humour and jokes.")
14 | .build();
15 |
16 | // Prompt the agent and print the response
17 | let response = comedian_agent.prompt("Entertain me!").await?;
18 | println!("{}", response);
19 |
20 | Ok(())
21 | }
22 |
--------------------------------------------------------------------------------
/rig-core/examples/anthropic_agent.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 |
3 | use rig::{
4 | completion::Prompt,
5 | providers::anthropic::{self, CLAUDE_3_5_SONNET},
6 | };
7 |
8 | #[tokio::main]
9 | async fn main() -> Result<(), anyhow::Error> {
10 | // Create OpenAI client
11 | let client = anthropic::ClientBuilder::new(
12 | &env::var("ANTHROPIC_API_KEY").expect("ANTHROPIC_API_KEY not set"),
13 | )
14 | .build();
15 |
16 | // Create agent with a single context prompt
17 | let agent = client
18 | .agent(CLAUDE_3_5_SONNET)
19 | .preamble("Be precise and concise.")
20 | .temperature(0.5)
21 | .max_tokens(8192)
22 | .build();
23 |
24 | // Prompt the agent and print the response
25 | let response = agent
26 | .prompt("When and where and what type is the next solar eclipse?")
27 | .await?;
28 | println!("{}", response);
29 |
30 | Ok(())
31 | }
32 |
--------------------------------------------------------------------------------
/rig-lancedb/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-lancedb"
3 | version = "0.2.0"
4 | edition = "2021"
5 | license = "MIT"
6 | readme = "README.md"
7 | description = "Rig vector store index integration for LanceDB."
8 | repository = "https://github.com/0xPlaygrounds/rig"
9 |
10 | [dependencies]
11 | lancedb = "0.10.0"
12 | rig-core = { path = "../rig-core", version = "0.5.0" }
13 | arrow-array = "52.2.0"
14 | serde_json = "1.0.128"
15 | serde = "1.0.210"
16 | futures = "0.3.30"
17 |
18 | [dev-dependencies]
19 | tokio = "1.40.0"
20 | anyhow = "1.0.89"
21 |
22 | [[example]]
23 | name = "vector_search_local_ann"
24 | required-features = ["rig-core/derive"]
25 |
26 | [[example]]
27 | name = "vector_search_local_enn"
28 | required-features = ["rig-core/derive"]
29 |
30 | [[example]]
31 | name = "vector_search_s3_ann"
32 | required-features = ["rig-core/derive"]
33 |
34 | [[test]]
35 | name = "integration_tests"
36 | required-features = ["rig-core/derive"]
--------------------------------------------------------------------------------
/rig-mongodb/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-mongodb"
3 | version = "0.2.0"
4 | edition = "2021"
5 | license = "MIT"
6 | readme = "README.md"
7 | description = "MongoDB implementation of a Rig vector store."
8 | repository = "https://github.com/0xPlaygrounds/rig"
9 |
10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11 |
12 | [dependencies]
13 | futures = "0.3.30"
14 | mongodb = "3.1.0"
15 | rig-core = { path = "../rig-core", version = "0.5.0" }
16 | serde = { version = "1.0.203", features = ["derive"] }
17 | serde_json = "1.0.117"
18 | tracing = "0.1.40"
19 |
20 | [dev-dependencies]
21 | anyhow = "1.0.86"
22 | testcontainers = "0.23.1"
23 | tokio = { version = "1.38.0", features = ["macros"] }
24 |
25 | [[example]]
26 | name = "vector_search_mongodb"
27 | required-features = ["rig-core/derive"]
28 |
29 | [[test]]
30 | name = "integration_tests"
31 | required-features = ["rig-core/derive"]
32 |
--------------------------------------------------------------------------------
/rig-qdrant/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [Unreleased]
9 |
10 | ## [0.1.3](https://github.com/0xPlaygrounds/rig/compare/rig-qdrant-v0.1.2...rig-qdrant-v0.1.3) - 2024-12-03
11 |
12 | ### Added
13 |
14 | - embeddings API overhaul ([#120](https://github.com/0xPlaygrounds/rig/pull/120))
15 |
16 | ### Other
17 |
18 | - *(integration test)* Neo4J ([#133](https://github.com/0xPlaygrounds/rig/pull/133))
19 | - *(integration test)* Qdrant ([#134](https://github.com/0xPlaygrounds/rig/pull/134))
20 |
21 | ## [0.1.2](https://github.com/0xPlaygrounds/rig/compare/rig-qdrant-v0.1.1...rig-qdrant-v0.1.2) - 2024-11-13
22 |
23 | ### Other
24 |
25 | - updated the following local packages: rig-core
26 |
--------------------------------------------------------------------------------
/rig-core/src/loaders/mod.rs:
--------------------------------------------------------------------------------
1 | //! This module provides utility structs for loading and preprocessing files.
2 | //!
3 | //! The [FileLoader] struct can be used to define a common interface for loading any type of files from disk,
4 | //! as well as performing minimal preprocessing on the files, such as reading their contents, ignoring errors
5 | //! and keeping track of file paths along with their contents.
6 | //!
7 | //! The [PdfFileLoader] works similarly to the [FileLoader], but is specifically designed to load PDF
8 | //! files. This loader also provides PDF-specific preprocessing methods for splitting the PDF into pages
9 | //! and keeping track of the page numbers along with their contents.
10 | //!
11 | //! Note: The [PdfFileLoader] requires the `pdf` feature to be enabled in the `Cargo.toml` file.
12 |
13 | pub mod file;
14 |
15 | pub use file::FileLoader;
16 |
17 | #[cfg(feature = "pdf")]
18 | pub mod pdf;
19 |
20 | #[cfg(feature = "pdf")]
21 | pub use pdf::PdfFileLoader;
22 |
--------------------------------------------------------------------------------
/rig-core/rig-core-derive/src/basic.rs:
--------------------------------------------------------------------------------
1 | use syn::{parse_quote, Attribute, DataStruct, Meta};
2 |
3 | use crate::EMBED;
4 |
5 | /// Finds and returns fields with simple `#[embed]` attribute tags only.
6 | pub(crate) fn basic_embed_fields(data_struct: &DataStruct) -> impl Iterator {
7 | data_struct.fields.iter().filter(|field| {
8 | field.attrs.iter().any(|attribute| match attribute {
9 | Attribute {
10 | meta: Meta::Path(path),
11 | ..
12 | } => path.is_ident(EMBED),
13 | _ => false,
14 | })
15 | })
16 | }
17 |
18 | /// Adds bounds to where clause that force all fields tagged with `#[embed]` to implement the `Embed` trait.
19 | pub(crate) fn add_struct_bounds(generics: &mut syn::Generics, field_type: &syn::Type) {
20 | let where_clause = generics.make_where_clause();
21 |
22 | where_clause.predicates.push(parse_quote! {
23 | #field_type: Embed
24 | });
25 | }
26 |
--------------------------------------------------------------------------------
/rig-core/examples/sentiment_classifier.rs:
--------------------------------------------------------------------------------
1 | use rig::providers::openai;
2 | use schemars::JsonSchema;
3 | use serde::{Deserialize, Serialize};
4 |
5 | #[derive(Debug, Deserialize, JsonSchema, Serialize)]
6 | /// An enum representing the sentiment of a document
7 | enum Sentiment {
8 | Positive,
9 | Negative,
10 | Neutral,
11 | }
12 |
13 | #[derive(Debug, Deserialize, JsonSchema, Serialize)]
14 | struct DocumentSentiment {
15 | /// The sentiment of the document
16 | sentiment: Sentiment,
17 | }
18 |
19 | #[tokio::main]
20 | async fn main() {
21 | // Create OpenAI client
22 | let openai_client = openai::Client::from_env();
23 |
24 | // Create extractor
25 | let data_extractor = openai_client
26 | .extractor::("gpt-4")
27 | .build();
28 |
29 | let sentiment = data_extractor
30 | .extract("I am happy")
31 | .await
32 | .expect("Failed to extract sentiment");
33 |
34 | println!("GPT-4: {:?}", sentiment);
35 | }
36 |
--------------------------------------------------------------------------------
/rig-neo4j/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rig-neo4j"
3 | version = "0.2.0"
4 | edition = "2021"
5 | license = "MIT"
6 | readme = "README.md"
7 | description = "Neo4j implementation of a Rig vector store."
8 | repository = "https://github.com/0xPlaygrounds/rig"
9 |
10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11 |
12 | [dependencies]
13 | futures = "0.3.30"
14 | neo4rs = "0.8.0"
15 | rig-core = { path = "../rig-core", version = "0.5.0" }
16 | serde = { version = "1.0.203", features = ["derive"] }
17 | serde_json = "1.0.117"
18 | tracing = "0.1.40"
19 |
20 | [dev-dependencies]
21 | anyhow = "1.0.86"
22 | tokio = { version = "1.38.0", features = ["macros"] }
23 | textwrap = { version = "0.16.1"}
24 | term_size = { version = "0.3.2"}
25 | testcontainers = "0.23.1"
26 | tracing-subscriber = "0.3.18"
27 |
28 | [[example]]
29 | name = "vector_search_simple"
30 | required-features = ["rig-core/derive"]
31 |
32 | [[test]]
33 | name = "integration_tests"
34 | required-features = ["rig-core/derive"]
35 |
--------------------------------------------------------------------------------
/.github/workflows/cd.yaml:
--------------------------------------------------------------------------------
1 | name: "Build & Release"
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | workflow_dispatch:
8 |
9 | jobs:
10 | run-ci:
11 | permissions:
12 | checks: write
13 | uses: ./.github/workflows/ci.yaml
14 | secrets: inherit
15 |
16 | release-plz:
17 | name: Release-plz
18 | needs: run-ci
19 | runs-on: ubuntu-latest
20 | permissions:
21 | pull-requests: write
22 | contents: write
23 | steps:
24 | - name: Checkout
25 | uses: actions/checkout@v4
26 | with:
27 | fetch-depth: 0
28 |
29 | - name: Install Rust toolchain
30 | uses: actions-rust-lang/setup-rust-toolchain@v1
31 |
32 | # Required to compile rig-lancedb
33 | - name: Install Protoc
34 | uses: arduino/setup-protoc@v3
35 |
36 | - name: Run release-plz
37 | uses: MarcoIeni/release-plz-action@v0.5
38 | env:
39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-core/examples/perplexity_agent.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 |
3 | use rig::{
4 | completion::Prompt,
5 | providers::{self, perplexity::LLAMA_3_1_70B_INSTRUCT},
6 | };
7 | use serde_json::json;
8 |
9 | #[tokio::main]
10 | async fn main() -> Result<(), anyhow::Error> {
11 | // Create OpenAI client
12 | let client = providers::perplexity::Client::new(
13 | &env::var("PERPLEXITY_API_KEY").expect("PERPLEXITY_API_KEY not set"),
14 | );
15 |
16 | // Create agent with a single context prompt
17 | let agent = client
18 | .agent(LLAMA_3_1_70B_INSTRUCT)
19 | .preamble("Be precise and concise.")
20 | .temperature(0.5)
21 | .additional_params(json!({
22 | "return_related_questions": true,
23 | "return_images": true
24 | }))
25 | .build();
26 |
27 | // Prompt the agent and print the response
28 | let response = agent
29 | .prompt("When and where and what type is the next solar eclipse?")
30 | .await?;
31 | println!("{}", response);
32 |
33 | Ok(())
34 | }
35 |
--------------------------------------------------------------------------------
/rig-core/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-lancedb/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-mongodb/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-neo4j/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-qdrant/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-sqlite/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Playgrounds Analytics Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/rig-core/examples/extractor.rs:
--------------------------------------------------------------------------------
1 | use rig::providers::openai;
2 | use schemars::JsonSchema;
3 | use serde::{Deserialize, Serialize};
4 |
5 | #[derive(Debug, Deserialize, JsonSchema, Serialize)]
6 | /// A record representing a person
7 | struct Person {
8 | /// The person's first name, if provided (null otherwise)
9 | pub first_name: Option,
10 | /// The person's last name, if provided (null otherwise)
11 | pub last_name: Option,
12 | /// The person's job, if provided (null otherwise)
13 | pub job: Option,
14 | }
15 |
16 | #[tokio::main]
17 | async fn main() -> Result<(), anyhow::Error> {
18 | // Create OpenAI client
19 | let openai_client = openai::Client::from_env();
20 |
21 | // Create extractor
22 | let data_extractor = openai_client.extractor::("gpt-4").build();
23 |
24 | let person = data_extractor
25 | .extract("Hello my name is John Doe! I am a software engineer.")
26 | .await?;
27 |
28 | println!("GPT-4: {}", serde_json::to_string_pretty(&person).unwrap());
29 |
30 | Ok(())
31 | }
32 |
--------------------------------------------------------------------------------
/rig-core/examples/agent_with_loaders.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 |
3 | use rig::{
4 | agent::AgentBuilder,
5 | completion::Prompt,
6 | loaders::FileLoader,
7 | providers::openai::{self, GPT_4O},
8 | };
9 |
10 | #[tokio::main]
11 | async fn main() -> Result<(), anyhow::Error> {
12 | let openai_client =
13 | openai::Client::new(&env::var("OPENAI_API_KEY").expect("OPENAI_API_KEY not set"));
14 |
15 | let model = openai_client.completion_model(GPT_4O);
16 |
17 | // Load in all the rust examples
18 | let examples = FileLoader::with_glob("rig-core/examples/*.rs")?
19 | .read_with_path()
20 | .ignore_errors()
21 | .into_iter();
22 |
23 | // Create an agent with multiple context documents
24 | let agent = examples
25 | .fold(AgentBuilder::new(model), |builder, (path, content)| {
26 | builder.context(format!("Rust Example {:?}:\n{}", path, content).as_str())
27 | })
28 | .build();
29 |
30 | // Prompt the agent and print the response
31 | let response = agent
32 | .prompt("Which rust example is best suited for the operation 1 + 2")
33 | .await?;
34 |
35 | println!("{}", response);
36 |
37 | Ok(())
38 | }
39 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/new-model-provider.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: New model provider
3 | about: Suggest a new model provider to integrate
4 | title: 'feat: Add support for X'
5 | labels: feat, model
6 | assignees: ''
7 |
8 | ---
9 |
10 | # New model provider:
11 |
12 | ## Description
13 |
14 | Please describe the model provider you are adding to the project. Include links to their website and their api documentation.
15 |
16 | Fixes # (issue)
17 |
18 | ## Testing
19 |
20 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce your results.
21 |
22 | - [ ] Test A
23 | - [ ] Test B
24 |
25 | ## Checklist:
26 |
27 | - [ ] My code follows the style guidelines of this project
28 | - [ ] I have commented my code, particularly in hard-to-understand areas
29 | - [ ] I have made corresponding changes to the documentation
30 | - [ ] My changes generate no new warnings
31 | - [ ] I have added tests that prove my fix is effective or that my feature works
32 | - [ ] New and existing unit tests pass locally with my changes
33 | - [ ] I've reviewed the provider API documentation and implemented the types of response accurately
34 |
35 | ## Notes
36 |
37 | Any notes you wish to include about the nature of this PR (implementation details, specific questions, etc.)
38 |
--------------------------------------------------------------------------------
/rig-core/examples/agent_with_context.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 |
3 | use rig::{agent::AgentBuilder, completion::Prompt, providers::cohere};
4 |
5 | #[tokio::main]
6 | async fn main() -> Result<(), anyhow::Error> {
7 | // Create OpenAI and Cohere clients
8 | // let openai_client = openai::Client::new(&env::var("OPENAI_API_KEY").expect("OPENAI_API_KEY not set"));
9 | let cohere_client =
10 | cohere::Client::new(&env::var("COHERE_API_KEY").expect("COHERE_API_KEY not set"));
11 |
12 | // let model = openai_client.completion_model("gpt-4");
13 | let model = cohere_client.completion_model("command-r");
14 |
15 | // Create an agent with multiple context documents
16 | let agent = AgentBuilder::new(model)
17 | .context("Definition of a *flurbo*: A flurbo is a green alien that lives on cold planets")
18 | .context("Definition of a *glarb-glarb*: A glarb-glarb is a ancient tool used by the ancestors of the inhabitants of planet Jiro to farm the land.")
19 | .context("Definition of a *linglingdong*: A term used by inhabitants of the far side of the moon to describe humans.")
20 | .build();
21 |
22 | // Prompt the agent and print the response
23 | let response = agent.prompt("What does \"glarb-glarb\" mean?").await?;
24 |
25 | println!("{}", response);
26 |
27 | Ok(())
28 | }
29 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: General pull request
3 | about: Makes a change to the code base
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | #
11 |
12 | ## Description
13 |
14 | Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
15 |
16 | Fixes # (issue)
17 |
18 | ## Type of change
19 |
20 | Please delete options that are not relevant.
21 |
22 | - [ ] Bug fix
23 | - [ ] New feature
24 | - [ ] Breaking change
25 | - [ ] Documentation update
26 |
27 | ## Testing
28 |
29 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce your results.
30 |
31 | - [ ] Test A
32 | - [ ] Test B
33 |
34 | ## Checklist:
35 |
36 | - [ ] My code follows the style guidelines of this project
37 | - [ ] I have commented my code, particularly in hard-to-understand areas
38 | - [ ] I have made corresponding changes to the documentation
39 | - [ ] My changes generate no new warnings
40 | - [ ] I have added tests that prove my fix is effective or that my feature works
41 | - [ ] New and existing unit tests pass locally with my changes
42 |
43 | ## Notes
44 |
45 | Any notes you wish to include about the nature of this PR (implementation details, specific questions, etc.)
46 |
--------------------------------------------------------------------------------
/rig-neo4j/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [Unreleased]
9 |
10 | ## [0.2.0](https://github.com/0xPlaygrounds/rig/compare/rig-neo4j-v0.1.2...rig-neo4j-v0.2.0) - 2024-12-03
11 |
12 | ### Added
13 |
14 | - embeddings API overhaul ([#120](https://github.com/0xPlaygrounds/rig/pull/120))
15 |
16 | ### Fixed
17 |
18 | - *(neo4j)* remove embeddings from top_n lookup ([#118](https://github.com/0xPlaygrounds/rig/pull/118))
19 |
20 | ### Other
21 |
22 | - *(integration test)* Neo4J ([#133](https://github.com/0xPlaygrounds/rig/pull/133))
23 |
24 | ## [0.1.2](https://github.com/0xPlaygrounds/rig/compare/rig-neo4j-v0.1.1...rig-neo4j-v0.1.2) - 2024-11-13
25 |
26 | ### Other
27 |
28 | - updated the following local packages: rig-core
29 |
30 | ## [0.1.1](https://github.com/0xPlaygrounds/rig/compare/rig-neo4j-v0.1.0...rig-neo4j-v0.1.1) - 2024-11-07
31 |
32 | ### Fixed
33 |
34 | - *(neo4j)* last minute doc and const adjustments
35 |
36 | ## [0.1.0](https://github.com/0xPlaygrounds/rig/compare/rig-mongodb-v0.0.7...rig-mongodb-v0.1.0) - 2024-10-22
37 |
38 | ### Features
39 |
40 | - initial implementation
41 | - supports `top_n` search for an existing index and database
42 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/new-vector-store.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Vector store integration request
3 | about: Suggest a new vector store to integrate
4 | title: 'feat: Add support for X vector store'
5 | labels: data store, feat
6 | assignees: ''
7 |
8 | ---
9 |
10 | # New vector store:
11 |
12 | ## Description
13 |
14 | Please describe the vector store you are adding to the project. Include links to their website and their api documentation.
15 |
16 | Fixes # (issue)
17 |
18 | ## Testing
19 |
20 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce your results.
21 |
22 | - [ ] Test A
23 | - [ ] Test B
24 |
25 | ## Checklist:
26 |
27 | - [ ] My code follows the style guidelines of this project
28 | - [ ] I have performed a self-review of my own code
29 | - [ ] I have commented my code, particularly in hard-to-understand areas
30 | - [ ] I have made corresponding changes to the documentation
31 | - [ ] My changes generate no new warnings
32 | - [ ] I have added tests that prove my fix is effective or that my feature works
33 | - [ ] New and existing unit tests pass locally with my changes
34 | - [ ] Any dependent changes have been merged and published in downstream modules
35 | - [ ] I've reviewed the vector store API documentation and implemented the types of response accurately
36 |
37 | ## Notes
38 |
39 | Any notes you wish to include about the nature of this PR (implementation details, specific questions, etc.)
40 |
--------------------------------------------------------------------------------
/rig-lancedb/README.md:
--------------------------------------------------------------------------------
1 |
16 |
17 | ## Rig-Lancedb
18 | This companion crate implements a Rig vector store based on Lancedb.
19 |
20 | ## Usage
21 |
22 | Add the companion crate to your `Cargo.toml`, along with the rig-core crate:
23 |
24 | ```toml
25 | [dependencies]
26 | rig-lancedb = "0.1.0"
27 | rig-core = "0.4.0"
28 | ```
29 |
30 | You can also run `cargo add rig-lancedb rig-core` to add the most recent versions of the dependencies to your project.
31 |
32 | See the [`/examples`](./examples) folder for usage examples.
33 |
--------------------------------------------------------------------------------
/rig-mongodb/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |