1---
2sidebar_position: 0
3title: 'Spice.ai OSS Documentation'
4description: 'Spice is an open-source SQL query and AI compute engine, written in Rust, for data-driven applications and AI agents. Learn about data federation, acceleration, RAG, and building intelligent apps.'
5image: /img/og/spiceai.png
6keywords:
7 [
8 spice.ai,
9 sql engine,
10 ai compute,
11 data federation,
12 data acceleration,
13 rag,
14 retrieval augmented generation,
15 datafusion,
16 duckdb,
17 arrow flight,
18 rust,
19 llm,
20 openai
21 ]
22---
23
24import ThemeBasedImage from '@site/src/components/ThemeBasedImage'
25
26# Spice.ai Open Source
27
28**Spice** is a SQL query, search, and LLM-inference engine, written in Rust, for data-driven applications and AI agents.
29
30
31
32Spice provides four industry-standard APIs in a lightweight, portable runtime (single ~140 MB binary):
33
341. **SQL Query & Search APIs**: Supports HTTP, Arrow Flight, Arrow Flight SQL, ODBC, JDBC, ADBC, and `vector_search` and `text_search` UDTFs.
352. **OpenAI-Compatible APIs**: Provides HTTP APIs for OpenAI SDK compatibility, local model serving (CUDA/Metal accelerated), and hosted model gateway.
363. **Iceberg Catalog REST APIs**: Offers a unified API for Iceberg Catalog.
374. **MCP HTTP+SSE APIs**: Enables integration with external tools via Model Context Protocol (MCP) using HTTP and Server-Sent Events (SSE).
38
39:::tip[Goal 🎯]
40Developers can focus on building data apps and AI agents confidently, knowing they are grounded in data.
41:::
42
43Spice is primarily used for:
44
45- **Data Federation**: SQL query across any database, data warehouse, or data lake. [Learn More](https://spiceai.org/docs/features/query-federation).
46- **Data Materialization and Acceleration**: Materialize, accelerate, and cache database queries. [Read the MaterializedView interview - Building a CDN for Databases](https://materializedview.io/p/building-a-cdn-for-databases-spice-ai).
47- **Enterprise Search**: Keyword, vector, and full-text search with Tantivy-powered BM25 and vector similarity search for structured and unstructured data. [Learn More](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md).
48- **AI Apps and Agents**: An AI-database powering retrieval-augmented generation (RAG) and intelligent agents. [Learn More](https://spiceai.org/docs/use-cases/rag).
49
50:::info[Watch 🎥]
51
52- [CMU Databases - Accelerating Data and AI with Spice.ai Open-Source](https://www.youtube.com/watch?v=tyM-ec1lKfU)
53- [Query Data using Spice, OpenAI, and MCP](https://www.youtube.com/watch?v=TFAu4qxjTPk&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=8)
54- [Search with Amazon S3 Vectors](https://www.youtube.com/watch?v=QPbqPf5W36g)
55 :::
56
57Spice is built on industry-leading technologies including [Apache DataFusion](https://datafusion.apache.org), Apache Arrow, Arrow Flight, SQLite, and DuckDB. If you want to build with DataFusion or DuckDB, Spice provides a simple, flexible, and production-ready engine.
58
59<div style={{ display: 'flex', justifyContent: 'center' }}>
60 <ThemeBasedImage
61 width='600'
62 alt='How Spice works'
63 lightSrc='https://github.com/spiceai/spiceai/assets/80174/7d93ae32-d6d8-437b-88d3-d64fe089e4b7'
64 darkSrc='https://github.com/spiceai/spiceai/assets/80174/96b5fcef-a550-4ce8-a74a-83931275e83e'
65 />
66</div>
67
68:::info[Announcement 📣]
69Read the [Spice.ai 1.0-stable announcement](https://spice.ai/blog/announcing-1.0-stable).
70:::
71
72## Why Spice?
73
74Spice simplifies building data-driven AI applications and agents by combining SQL query, search, and LLM inference in a single runtime. Instead of stitching together separate databases, caching layers, and AI services, developers deploy Spice alongside their applications to:
75
76- **Query any data source with SQL**: Join data across PostgreSQL, Snowflake, S3, and other sources without building ETL pipelines.
77- **Accelerate queries locally**: Materialize datasets in-memory or on disk for sub-second query performance, with automatic refresh from source.
78- **Ground AI in real data**: Connect LLMs to datasets through built-in tools so AI responses are based on actual data, not hallucinations.
79- **Search across data**: Run vector, keyword, and hybrid search through SQL functions like `vector_search()` and `text_search()`.
80
81<div style={{ display: 'flex', justifyContent: 'center' }}>
82 <ThemeBasedImage
83 width='800'
84 alt='Spice.ai'
85 lightSrc='https://github.com/spiceai/spiceai/assets/80174/29e4421d-8942-4f2a-8397-e9d4fdeda36b'
86 darkSrc='https://github.com/spiceai/spiceai/assets/80174/96b5fcef-a550-4ce8-a74a-83931275e83e'
87 />
88</div>
89
90### How is Spice different?
91
921. **AI-Native Runtime**: Combines data query and AI inference in a single engine for data-grounded, accurate AI.
932. **Application-Focused**: Designed for distributed deployment at the application or agent level, often as a 1:1 or 1:N mapping, unlike centralized databases serving multiple apps. Multiple Spice instances can be deployed, even one per tenant or customer.
943. **Dual-Engine Acceleration**: Supports **OLAP** (Arrow/DuckDB) and **OLTP** (SQLite/PostgreSQL) engines at the dataset level for flexible performance across analytical and transactional workloads.
954. **Disaggregated Storage**: Separates compute from storage, co-locating materialized working datasets with applications, dashboards, or ML pipelines while accessing source data in its original storage.
965. **Edge to Cloud Native**: Deploy as a standalone instance, Kubernetes sidecar, microservice, or cluster across edge, on-prem, and public clouds. Chain multiple Spice instances for tier-optimized, distributed deployments.
97
98For detailed comparisons with other data query engines and AI frameworks, see [How Spice Compares](./comparison.md).
99
100## Example Use-Cases
101
102### Data-Grounded Agentic AI Applications
103
104- **OpenAI-Compatible API**: Connect to hosted models (OpenAI, Anthropic, xAI) or deploy locally (Llama, NVIDIA NIM). [AI Gateway Recipe](https://github.com/spiceai/cookbook/blob/trunk/openai_sdk/README.md)
105- **Federated Data Access**: Query using SQL and NSQL (text-to-SQL) across databases, data warehouses, and data lakes with advanced query push-down. [Federated SQL Query Recipe](https://github.com/spiceai/cookbook/blob/trunk/federation/README.md)
106- **Search and RAG**: Perform keyword, vector, and full-text search with Tantivy-powered BM25 and vector similarity search (VSS) integrated into SQL queries using `vector_search` and `text_search`. Supports multi-column vector search with reciprocal rank fusion. [Amazon S3 Vectors Recipe](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md)
107- **LLM Memory and Observability**: Store and retrieve history and context for AI agents with visibility into data flows, model performance, and traces. [LLM Memory Recipe](https://github.com/spiceai/cookbook/blob/trunk/llm-memory/README.md) | [Observability Documentation](https://spiceai.org/docs/features/observability)
108
109### Database CDN and Query Mesh
110
111- **Data Acceleration**: Co-locate materialized datasets in Arrow, SQLite, or DuckDB for sub-second queries. [DuckDB Data Accelerator Recipe](https://github.com/spiceai/cookbook/blob/trunk/duckdb/accelerator/README.md)
112- **Resiliency and Local Dataset Replication**: Maintain availability with local replicas of critical datasets. [Local Dataset Replication Recipe](https://github.com/spiceai/cookbook/blob/trunk/localpod/README.md)
113- **Responsive Dashboards**: Enable fast, real-time analytics for frontends and BI tools. [Sales BI Dashboard Demo](https://github.com/spiceai/cookbook/blob/trunk/sales-bi/README.md)
114- **Simplified Legacy Migration**: Unify legacy systems with modern infrastructure via federated SQL querying. [Federated SQL Query Recipe](https://github.com/spiceai/cookbook/blob/trunk/federation/README.md)
115
116### Retrieval-Augmented Generation (RAG)
117
118- **Unified Search with Vector Similarity**: Perform efficient vector similarity search across structured and unstructured data, with native support for Amazon S3 Vectors for petabyte-scale storage and querying. Supports distance metrics like cosine similarity, Euclidean distance, or dot product. [Amazon S3 Vectors Recipe](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md)
119- **Semantic Knowledge Layer**: Define a semantic context model to enrich data for AI. [Semantic Model Documentation](./features/semantic-model/index.md)
120- **Text-to-SQL**: Convert natural language queries into SQL using built-in NSQL and sampling tools. [Text-to-SQL Recipe](https://github.com/spiceai/cookbook/blob/trunk/text-to-sql/README.md)
121
122## FAQ
123
124- **Is Spice a cache?** No, but its data acceleration acts as an active cache, materialization, or prefetcher. Unlike traditional caches that fetch on miss, Spice prefetches and materializes filtered data on intervals, triggers, or via CDC. It also supports [results caching](https://spiceai.org/docs/features/caching).
125- **Is Spice a CDN for databases?** Yes, Spice enables shipping working datasets to where they're accessed most, like data-intensive applications or AI contexts, similar to a CDN. [Docs FAQ](./faq/index.md)
126
127### Watch a 30-second BI dashboard acceleration demo
128
129<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '15px' }}>
130 <iframe
131 width='640'
132 height='360'
133 src='https://www.youtube.com/embed/t3B2AyshVY0'
134 frameBorder='0'
135 allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'
136 allowFullScreen
137 />
138</div>
139
140See more demos on [YouTube](https://www.youtube.com/playlist?list=PLesJrUXEx3U9anekJvbjyyTm7r9A26ugK).
141
142### Intelligent Applications and Agents
143
144Spice enables developers to build data-grounded AI applications and agents by co-locating data and ML models with applications. Read more about the vision for [intelligent AI-driven applications](./use-cases/index.md).
145
146### Connect with Us
147
148- Build with Spice and share feedback at [hey@spice.ai](mailto:hey@spice.ai), [Slack](https://spice.ai/slack), [X](https://twitter.com/spice_ai), or [LinkedIn](https://www.linkedin.com/company/74148478).
149- [File an issue](https://github.com/spiceai/spiceai/issues/new) for bugs or issues.
150- Join our team ([We're hiring!](https://spice.ai/careers)).
151- Contribute code or documentation ([CONTRIBUTING.md](https://github.com/spiceai/spiceai/blob/trunk/CONTRIBUTING)).
152- ⭐️ Star the [Spice.ai repo](https://github.com/spiceai/spiceai) to show support!
153
1---
2sidebar_position: 0
3title: 'Spice.ai OSS Documentation'
4description: 'Spice is an open-source SQL query and AI compute engine, written in Rust, for data-driven applications and AI agents. Learn about data federation, acceleration, RAG, and building intelligent apps.'
5image: /img/og/spiceai.png
6keywords:
7 [
8 spice.ai,
9 sql engine,
10 ai compute,
11 data federation,
12 data acceleration,
13 rag,
14 retrieval augmented generation,
15 datafusion,
16 duckdb,
17 arrow flight,
18 rust,
19 llm,
20 openai
21 ]
22---
23
24import ThemeBasedImage from '@site/src/components/ThemeBasedImage'
25
26# Spice.ai Open Source
27
28**Spice** is a SQL query, search, and LLM-inference engine, written in Rust, for data-driven applications and AI agents.
29
30
31
32Spice provides four industry-standard APIs in a lightweight, portable runtime (single ~140 MB binary):
33
341. **SQL Query & Search APIs**: Supports HTTP, Arrow Flight, Arrow Flight SQL, ODBC, JDBC, ADBC, and `vector_search` and `text_search` UDTFs.
352. **OpenAI-Compatible APIs**: Provides HTTP APIs for OpenAI SDK compatibility, local model serving (CUDA/Metal accelerated), and hosted model gateway.
363. **Iceberg Catalog REST APIs**: Offers a unified API for Iceberg Catalog.
374. **MCP HTTP+SSE APIs**: Enables integration with external tools via Model Context Protocol (MCP) using HTTP and Server-Sent Events (SSE).
38
39:::tip[Goal 🎯]
40Developers can focus on building data apps and AI agents confidently, knowing they are grounded in data.
41:::
42
43Spice is primarily used for:
44
45- **Data Federation**: SQL query across any database, data warehouse, or data lake. [Learn More](https://spiceai.org/docs/features/query-federation).
46- **Data Materialization and Acceleration**: Materialize, accelerate, and cache database queries. [Read the MaterializedView interview - Building a CDN for Databases](https://materializedview.io/p/building-a-cdn-for-databases-spice-ai).
47- **Enterprise Search**: Keyword, vector, and full-text search with Tantivy-powered BM25 and vector similarity search for structured and unstructured data. [Learn More](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md).
48- **AI Apps and Agents**: An AI-database powering retrieval-augmented generation (RAG) and intelligent agents. [Learn More](https://spiceai.org/docs/use-cases/rag).
49
50:::info[Watch 🎥]
51
52- [CMU Databases - Accelerating Data and AI with Spice.ai Open-Source](https://www.youtube.com/watch?v=tyM-ec1lKfU)
53- [Query Data using Spice, OpenAI, and MCP](https://www.youtube.com/watch?v=TFAu4qxjTPk&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=8)
54- [Search with Amazon S3 Vectors](https://www.youtube.com/watch?v=QPbqPf5W36g)
55 :::
56
57Spice is built on industry-leading technologies including [Apache DataFusion](https://datafusion.apache.org), Apache Arrow, Arrow Flight, SQLite, and DuckDB. If you want to build with DataFusion or DuckDB, Spice provides a simple, flexible, and production-ready engine.
58
59<div style={{ display: 'flex', justifyContent: 'center' }}>
60 <ThemeBasedImage
61 width='600'
62 alt='How Spice works'
63 lightSrc='https://github.com/spiceai/spiceai/assets/80174/7d93ae32-d6d8-437b-88d3-d64fe089e4b7'
64 darkSrc='https://github.com/spiceai/spiceai/assets/80174/96b5fcef-a550-4ce8-a74a-83931275e83e'
65 />
66</div>
67
68:::info[Announcement 📣]
69Read the [Spice.ai 1.0-stable announcement](https://spice.ai/blog/announcing-1.0-stable).
70:::
71
72## Why Spice?
73
74Spice simplifies building data-driven AI applications and agents by combining SQL query, search, and LLM inference in a single runtime. Instead of stitching together separate databases, caching layers, and AI services, developers deploy Spice alongside their applications to:
75
76- **Query any data source with SQL**: Join data across PostgreSQL, Snowflake, S3, and other sources without building ETL pipelines.
77- **Accelerate queries locally**: Materialize datasets in-memory or on disk for sub-second query performance, with automatic refresh from source.
78- **Ground AI in real data**: Connect LLMs to datasets through built-in tools so AI responses are based on actual data, not hallucinations.
79- **Search across data**: Run vector, keyword, and hybrid search through SQL functions like `vector_search()` and `text_search()`.
80
81<div style={{ display: 'flex', justifyContent: 'center' }}>
82 <ThemeBasedImage
83 width='800'
84 alt='Spice.ai'
85 lightSrc='https://github.com/spiceai/spiceai/assets/80174/29e4421d-8942-4f2a-8397-e9d4fdeda36b'
86 darkSrc='https://github.com/spiceai/spiceai/assets/80174/96b5fcef-a550-4ce8-a74a-83931275e83e'
87 />
88</div>
89
90### How is Spice different?
91
921. **AI-Native Runtime**: Combines data query and AI inference in a single engine for data-grounded, accurate AI.
932. **Application-Focused**: Designed for distributed deployment at the application or agent level, often as a 1:1 or 1:N mapping, unlike centralized databases serving multiple apps. Multiple Spice instances can be deployed, even one per tenant or customer.
943. **Dual-Engine Acceleration**: Supports **OLAP** (Arrow/DuckDB) and **OLTP** (SQLite/PostgreSQL) engines at the dataset level for flexible performance across analytical and transactional workloads.
954. **Disaggregated Storage**: Separates compute from storage, co-locating materialized working datasets with applications, dashboards, or ML pipelines while accessing source data in its original storage.
965. **Edge to Cloud Native**: Deploy as a standalone instance, Kubernetes sidecar, microservice, or cluster across edge, on-prem, and public clouds. Chain multiple Spice instances for tier-optimized, distributed deployments.
97
98For detailed comparisons with other data query engines and AI frameworks, see [How Spice Compares](./comparison.md).
99
100## Example Use-Cases
101
102### Data-Grounded Agentic AI Applications
103
104- **OpenAI-Compatible API**: Connect to hosted models (OpenAI, Anthropic, xAI) or deploy locally (Llama, NVIDIA NIM). [AI Gateway Recipe](https://github.com/spiceai/cookbook/blob/trunk/openai_sdk/README.md)
105- **Federated Data Access**: Query using SQL and NSQL (text-to-SQL) across databases, data warehouses, and data lakes with advanced query push-down. [Federated SQL Query Recipe](https://github.com/spiceai/cookbook/blob/trunk/federation/README.md)
106- **Search and RAG**: Perform keyword, vector, and full-text search with Tantivy-powered BM25 and vector similarity search (VSS) integrated into SQL queries using `vector_search` and `text_search`. Supports multi-column vector search with reciprocal rank fusion. [Amazon S3 Vectors Recipe](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md)
107- **LLM Memory and Observability**: Store and retrieve history and context for AI agents with visibility into data flows, model performance, and traces. [LLM Memory Recipe](https://github.com/spiceai/cookbook/blob/trunk/llm-memory/README.md) | [Observability Documentation](https://spiceai.org/docs/features/observability)
108
109### Database CDN and Query Mesh
110
111- **Data Acceleration**: Co-locate materialized datasets in Arrow, SQLite, or DuckDB for sub-second queries. [DuckDB Data Accelerator Recipe](https://github.com/spiceai/cookbook/blob/trunk/duckdb/accelerator/README.md)
112- **Resiliency and Local Dataset Replication**: Maintain availability with local replicas of critical datasets. [Local Dataset Replication Recipe](https://github.com/spiceai/cookbook/blob/trunk/localpod/README.md)
113- **Responsive Dashboards**: Enable fast, real-time analytics for frontends and BI tools. [Sales BI Dashboard Demo](https://github.com/spiceai/cookbook/blob/trunk/sales-bi/README.md)
114- **Simplified Legacy Migration**: Unify legacy systems with modern infrastructure via federated SQL querying. [Federated SQL Query Recipe](https://github.com/spiceai/cookbook/blob/trunk/federation/README.md)
115
116### Retrieval-Augmented Generation (RAG)
117
118- **Unified Search with Vector Similarity**: Perform efficient vector similarity search across structured and unstructured data, with native support for Amazon S3 Vectors for petabyte-scale storage and querying. Supports distance metrics like cosine similarity, Euclidean distance, or dot product. [Amazon S3 Vectors Recipe](https://github.com/spiceai/cookbook/blob/trunk/vectors/s3/README.md)
119- **Semantic Knowledge Layer**: Define a semantic context model to enrich data for AI. [Semantic Model Documentation](./features/semantic-model/index.md)
120- **Text-to-SQL**: Convert natural language queries into SQL using built-in NSQL and sampling tools. [Text-to-SQL Recipe](https://github.com/spiceai/cookbook/blob/trunk/text-to-sql/README.md)
121
122## FAQ
123
124- **Is Spice a cache?** No, but its data acceleration acts as an active cache, materialization, or prefetcher. Unlike traditional caches that fetch on miss, Spice prefetches and materializes filtered data on intervals, triggers, or via CDC. It also supports [results caching](https://spiceai.org/docs/features/caching).
125- **Is Spice a CDN for databases?** Yes, Spice enables shipping working datasets to where they're accessed most, like data-intensive applications or AI contexts, similar to a CDN. [Docs FAQ](./faq/index.md)
126
127### Watch a 30-second BI dashboard acceleration demo
128
129<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '15px' }}>
130 <iframe
131 width='640'
132 height='360'
133 src='https://www.youtube.com/embed/t3B2AyshVY0'
134 frameBorder='0'
135 allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'
136 allowFullScreen
137 />
138</div>
139
140See more demos on [YouTube](https://www.youtube.com/playlist?list=PLesJrUXEx3U9anekJvbjyyTm7r9A26ugK).
141
142### Intelligent Applications and Agents
143
144Spice enables developers to build data-grounded AI applications and agents by co-locating data and ML models with applications. Read more about the vision for [intelligent AI-driven applications](./use-cases/index.md).
145
146### Connect with Us
147
148- Build with Spice and share feedback at [hey@spice.ai](mailto:hey@spice.ai), [Slack](https://spice.ai/slack), [X](https://twitter.com/spice_ai), or [LinkedIn](https://www.linkedin.com/company/74148478).
149- [File an issue](https://github.com/spiceai/spiceai/issues/new) for bugs or issues.
150- Join our team ([We're hiring!](https://spice.ai/careers)).
151- Contribute code or documentation ([CONTRIBUTING.md](https://github.com/spiceai/spiceai/blob/trunk/CONTRIBUTING)).
152- ⭐️ Star the [Spice.ai repo](https://github.com/spiceai/spiceai) to show support!
153
