Skip to content

Commit ee611de

Browse files
authored
Enhance documentation for Spice.ai use cases (#1408)
1 parent 26d879d commit ee611de

28 files changed

Lines changed: 1011 additions & 40 deletions

File tree

website/docs/use-cases/ai/agentic-apps/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ pagination_next: null
99

1010
Spice.ai builds intelligent, autonomous agents for SaaS applications, enabling context-aware automation and decision-making to improve user experiences and operational efficiency.
1111

12+
```mermaid
13+
graph LR
14+
Sources[Data Sources] --> Spice[Spice]
15+
Spice -->|Data + Search + AI| Agent[AI Agent]
16+
Agent -->|Autonomous Actions| App[Application]
17+
```
18+
1219
Unlike generic AI agent frameworks (e.g., AutoGen, CrewAI) that often lack direct integration with enterprise data or real-time capabilities, Spice.ai combines federated data access, hybrid search, and AI inference to deliver autonomous agents that operate with enterprise-grade governance and low-latency performance. This makes it ideal for SaaS platforms requiring dynamic, context-driven automation in customer-facing workflows.
1320

1421
## Why Spice.ai?

website/docs/use-cases/ai/edge-ai/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ pagination_next: null
99

1010
Spice.ai deploys AI applications and agents across cloud and edge for low-latency decisions in security IoT use cases, ensuring rapid threat detection and response in distributed environments.
1111

12+
```mermaid
13+
graph LR
14+
Cloud[Cloud Data] --> Spice[Spice - Edge]
15+
Sensors[Edge Sensors] --> Spice
16+
Spice --> Model[Local AI Model]
17+
Model --> Decision[Decision]
18+
```
19+
1220
Unlike cloud-centric AI platforms (e.g., AWS SageMaker, Google Vertex AI) that rely on constant connectivity and introduce latency, Spice.ai’s edge data materialization and local model inference enable real-time, resilient AI operations. This is critical for security applications requiring immediate action and functionality in low-connectivity scenarios, outperforming cloud-dependent solutions in speed and reliability.
1321

1422
## Why Spice.ai?

website/docs/use-cases/ai/federated-mcp-server/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ pagination_next: null
99

1010
Spice.ai federates external Model Context Protocol (MCP) servers over Server-Sent Events (SSE) for scalable, tool-driven AI applications in security, improving threat analysis with distributed tool ecosystems.
1111

12+
```mermaid
13+
graph LR
14+
MCP1[MCP Server A] --> Spice[Spice]
15+
MCP2[MCP Server B] --> Spice
16+
MCP3[MCP Server C] --> Spice
17+
Spice -->|Unified Tools + Data| LLM[LLM]
18+
LLM --> Response[Response]
19+
```
20+
1221
Unlike centralized AI orchestration platforms (e.g., Apache Airflow for AI workflows) that introduce complexity and latency, Spice.ai's federated MCP client approach supports modular, scalable tool integration with integrated data and AI capabilities. This makes it ideal for security applications requiring distributed, real-time threat intelligence, outperforming platforms with rigid, centralized architectures.
1322

1423
## Why Spice.ai?

website/docs/use-cases/ai/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'AI Applications and Agents'
33
sidebar_label: 'AI Apps & Agents'
4-
sidebar_position: 4
4+
sidebar_position: 5
55
description: 'AI Applications and Agents'
66
pagination_prev: null
77
pagination_next: null
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: 'Multi-Tenant AI Agents'
3+
sidebar_label: 'Multi-Tenant AI Agents'
4+
sidebar_position: 16
5+
description: 'Deploy AI agents across many SaaS tenants with strict isolation and no per-tenant ETL pipelines.'
6+
pagination_prev: null
7+
pagination_next: null
8+
---
9+
10+
Spice serves as the data substrate for multi-tenant AI agents, giving each tenant real-time access to its own data sources with configurable isolation and no per-tenant ETL pipelines. A lightweight Rust runtime can be deployed once for all tenants, once per tenant, or in a hybrid topology, and every deployment exposes the same SQL, search, and AI inference APIs over HTTP, Arrow Flight, FlightSQL, ODBC, JDBC, and ADBC.
11+
12+
```mermaid
13+
graph LR
14+
Agent[AI Agent or App] --> Router[Tenant Router]
15+
Router --> Dedicated1[Spice: Enterprise A]
16+
Router --> Dedicated2[Spice: Enterprise B]
17+
Router --> Shared[Spice: Shared Partitioned]
18+
Dedicated1 --> SourcesA[(Tenant A Sources)]
19+
Dedicated2 --> SourcesB[(Tenant B Sources)]
20+
Shared --> SourcesLT[(Long-Tail Tenant Sources)]
21+
```
22+
23+
Pipeline-per-integration architectures collapse at scale: every tenant brings its own schema, refresh cadence, and ownership, and ETL orchestration becomes the bottleneck. Spice federates queries across 30+ data sources and accelerates them locally, so adding a tenant is a Spicepod configuration change rather than a new pipeline.
24+
25+
## Why Spice.ai?
26+
27+
- **Zero-ETL federation**: Query PostgreSQL, Snowflake, Databricks, S3, Kafka, and 25+ other sources through a single SQL interface. Onboarding a tenant is a dataset declaration, not a pipeline build.
28+
- **Configurable isolation**: Choose logical, config-level, or runtime-level tenant boundaries. Isolation becomes a deployment property rather than something enforced in application code.
29+
- **Sandboxed runtimes**: The Spice runtime is lightweight enough to deploy one instance per tenant or per agent, giving each agent its own sources, acceleration layers, and secrets.
30+
- **Local acceleration with CDC**: Materialize tenant working sets into Arrow, DuckDB, SQLite, or PostgreSQL accelerators and keep them current with change data capture.
31+
- **Declarative configuration**: The [`spicepod.yaml`](../../../reference/spicepod) manifest defines datasets, models, secrets, and acceleration behavior, so tenant topology is version-controlled and auditable.
32+
33+
## Deployment Patterns
34+
35+
Four patterns trade off operational simplicity against isolation strength. Most SaaS workloads converge on a hybrid configuration.
36+
37+
### Pattern 1: Query-Time Tenant Isolation
38+
39+
One runtime serves many tenants. Datasets reference tenant-partitioned tables, and the application includes a tenant filter in every query.
40+
41+
```yaml
42+
version: v1
43+
kind: Spicepod
44+
name: saas-shared
45+
46+
datasets:
47+
- from: postgres:public.events
48+
name: events
49+
params:
50+
pg_host: db.shared.internal
51+
pg_port: '5432'
52+
pg_db: app
53+
pg_user: ${secrets:PG_USER}
54+
pg_pass: ${secrets:PG_PASS}
55+
acceleration:
56+
enabled: true
57+
engine: arrow
58+
refresh_check_interval: 1s
59+
```
60+
61+
This is the simplest and cheapest pattern to operate, but isolation is logical: correctness depends on every query path applying the tenant filter.
62+
63+
**View-based variant**: Move tenant filtering into the Spicepod using [views](../../../reference/spicepod/views), so agents query a tenant-specific view rather than constructing the filter at runtime.
64+
65+
```yaml
66+
datasets:
67+
- name: events
68+
from: postgres:public.events
69+
70+
views:
71+
- name: view_tenant_abc
72+
sql: "select * from events where tenant='tenant_abc'"
73+
- name: view_tenant_xyz
74+
sql: "select * from events where tenant='tenant_xyz'"
75+
```
76+
77+
### Pattern 2: Config-Level Tenant Isolation
78+
79+
One runtime, but each tenant gets its own dataset entry. The manifest is typically generated from tenant-onboarding metadata.
80+
81+
```yaml
82+
version: v1
83+
kind: Spicepod
84+
name: saas-many-datasets
85+
86+
datasets:
87+
- from: postgres:tenant_abc.events
88+
name: tenant_abc_events
89+
params:
90+
pg_host: db.pool.internal
91+
pg_db: app
92+
pg_user: ${secrets:PG_USER}
93+
pg_pass: ${secrets:PG_PASS}
94+
95+
- from: postgres:tenant_xyz.events
96+
name: tenant_xyz_events
97+
params:
98+
pg_host: db.pool.internal
99+
pg_db: app
100+
pg_user: ${secrets:PG_USER}
101+
pg_pass: ${secrets:PG_PASS}
102+
```
103+
104+
Tenant boundaries are explicit in configuration and easier to audit, but the manifest grows with tenant count and reload time and memory planning become operational concerns at large scale.
105+
106+
### Pattern 3: Runtime-Level Tenant Isolation
107+
108+
Run a dedicated Spicepod per tenant and route requests using tenant context from auth or session claims. Each runtime has an independent manifest, compute envelope, and cache.
109+
110+
```yaml
111+
version: v1
112+
kind: Spicepod
113+
name: tenant-abc
114+
115+
datasets:
116+
- from: postgres:public.events
117+
name: events
118+
params:
119+
pg_host: tenant-abc-db.internal
120+
pg_db: app
121+
pg_user: ${secrets:PG_USER}
122+
pg_pass: ${secrets:PG_PASS}
123+
acceleration:
124+
enabled: true
125+
engine: duckdb
126+
mode: file
127+
refresh_check_interval: 1s
128+
params:
129+
duckdb_file: /var/lib/spice/tenant-abc.db
130+
```
131+
132+
This gives the clearest isolation model and per-tenant operational control, at the cost of higher operational overhead as tenant count grows. It fits regulated workloads that require strict data boundaries.
133+
134+
### Pattern 4: Hybrid Isolation
135+
136+
Large tenants run on dedicated Spicepods while the long tail shares a partitioned deployment. A tenant-aware router decides placement and clients query a single logical interface.
137+
138+
```yaml
139+
# router config (conceptual)
140+
tenants:
141+
- id: enterprise-abc
142+
spicepod: spicepod-tenant-abc
143+
- id: enterprise-xyz
144+
spicepod: spicepod-tenant-xyz
145+
146+
default:
147+
spicepod: spicepod-shared
148+
```
149+
150+
Hybrid isolation keeps the query interface stable while allowing tenant placement by policy, isolating high-load or regulated tenants on dedicated runtimes and using shared capacity for the long tail. It is the recommended starting point for variable SaaS workloads.
151+
152+
## Choosing a Pattern
153+
154+
The right shape depends on isolation requirements, tenant count, and query volume per tenant.
155+
156+
| Requirement | Recommended Pattern |
157+
| --- | --- |
158+
| Small tenant count, uniform workload | Pattern 1 or 1-view |
159+
| Explicit config-level boundaries, auditable manifest | Pattern 2 |
160+
| Regulated tenants, strict per-tenant SLOs | Pattern 3 |
161+
| Power-law tenant distribution | Pattern 4 (hybrid) |
162+
163+
## Benefits
164+
165+
- **Zero-ETL onboarding**: Add a tenant by declaring a dataset, not by building a pipeline.
166+
- **Deployment-level isolation**: Match isolation strength to business and compliance requirements without changing application code.
167+
- **Consistent interface**: Agents query SQL, search, and inference APIs the same way regardless of how tenants are partitioned underneath.
168+
169+
## Learn More
170+
171+
- [Multi-Tenancy for AI Agents without the Pipelines](https://spice.ai/blog/multi-tenancy-for-ai-agents-without-pipelines) — the engineering deep dive behind these patterns.
172+
- [Spicepod reference](../../../reference/spicepod) and [datasets reference](../../../reference/spicepod/datasets).
173+
- [Views](../../../reference/spicepod/views) for declarative tenant filtering.
174+
- [Data Acceleration](../../../features/data-acceleration) and [Change Data Capture](../../../features/data-acceleration/data-refresh).
175+
- [Federated SQL Query recipe](https://github.com/spiceai/cookbook/blob/trunk/federation/README.md).

website/docs/use-cases/ai/object-store-ai-engine/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ pagination_next: null
99

1010
Spice.ai enables SQL queries, hybrid search, and large language model (LLM) inference on object-store data for security applications, delivering real-time insights from distributed data sources with minimal infrastructure overhead.
1111

12+
```mermaid
13+
graph LR
14+
S3[S3 / Object Store] --> Spice[Spice]
15+
Query[Query] --> Spice
16+
Spice -->|SQL + Search| Results[Results]
17+
Results --> LLM[LLM]
18+
LLM --> Insights[Insights]
19+
```
20+
1221
Unlike traditional data platforms (e.g., Snowflake, BigQuery) or separate search and AI frameworks (e.g., Elasticsearch, LangChain) that require complex data pipelines and centralized storage, Spice.ai integrates SQL querying, vector/keyword search, and LLM inference directly on object stores (e.g., S3, Azure Blob). This unified approach reduces latency, simplifies architecture, and ensures compliance for security applications, outperforming fragmented solutions that demand extensive data movement and integration.
1322

1423
## Why Spice.ai?

website/docs/use-cases/ai/real-time-decision-making/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ pagination_next: null
99

1010
Spice.ai powers instant, context-aware decisions for applications like security recommendations by grounding AI in federated, low-latency datasets.
1111

12+
```mermaid
13+
graph LR
14+
Sources[Multiple Data Sources] --> Spice[Spice]
15+
Spice -->|Accelerated Data| AI[AI Gateway]
16+
AI --> Decision[Real-Time Decision]
17+
```
18+
1219
Unlike batch-processing analytics platforms (e.g., traditional data warehouses), Spice.ai delivers real-time decisions by unifying disparate data sources and accelerating access, outpacing siloed pipelines that introduce delays and complexity.
1320

1421
## Why Spice.ai?

website/docs/use-cases/ai/tool-calling-ai/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ pagination_next: null
99

1010
Spice.ai extends AI with custom tools via Model Context Protocol (MCP) server in financial services (finserv), integrating domain-specific APIs for enhanced functionality and precise decision-making in high-stakes financial applications.
1111

12+
```mermaid
13+
graph LR
14+
Client[AI Client] -->|Request| Spice[Spice MCP Server]
15+
Spice -->|Tool Call| Tools[Custom Tools]
16+
Spice -->|Query| Data[Federated Data]
17+
Spice -->|Response| Client
18+
```
19+
1220
Unlike generic tool-calling frameworks (e.g., OpenAI Functions) that rely on external APIs and lack deep data integration, Spice.ai's stdio-based MCP servers provide low-latency, secure tool interactions with federated data access. This makes it ideal for finserv applications requiring compliance, real-time performance, and tailored AI capabilities, outperforming platforms with limited domain-specific tool integration.
1321

1422
## Why Spice.ai?

0 commit comments

Comments
 (0)