Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions website/docs/components/tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ For details on tool specifications, see the [Tools Spicepod Reference](/docs/ref

### Available Tools

| Name | Description | Default Group |
| ------------------------- | ----------------------------------------------------------------- | ----------------- |
| `list_datasets` | List all available datasets in the runtime. | `auto` |
| `sql` | Execute SQL queries on the runtime. | `auto` |
| `table_schema` | Get the schema of a specific SQL table. | `auto` |
| `document_similarity` | Retrieve documents based on an input query. | `auto` |
| `sample_distinct_columns` | Generate a synthetic sample of data with distinct values. | `auto` |
| `random_sample` | Sample random rows from a table. | `auto` |
| `top_n_sample` | Sample the top N rows from a table based on a specified ordering. | `auto` |
| `memory:load` | Retrieve all stored memories from the last time period. | `memory` |
| `memory:store` | Store information from LLM interaction(s) for future reference. | `memory` |
| Name | Description | Default Group |
| ------------------------- | ----------------------------------------------------------------- | ------------- |
| `list_datasets` | List all available datasets in the runtime. | `auto` |
| `sql` | Execute SQL queries on the runtime. | `auto` |
| `table_schema` | Get the schema of a specific SQL table. | `auto` |
| `document_similarity` | Retrieve documents based on an input query. | `auto` |
| `sample_distinct_columns` | Generate a synthetic sample of data with distinct values. | `auto` |
| `random_sample` | Sample random rows from a table. | `auto` |
| `top_n_sample` | Sample the top N rows from a table based on a specified ordering. | `auto` |
| `memory:load` | Retrieve all stored memories from the last time period. | `memory` |
| `memory:store` | Store information from LLM interaction(s) for future reference. | `memory` |

### Tool Groups

Tool groups are predefined sets of tools that can be provided to LLMs in a single tool name. For example, the `auto` tool group provides all default tools to the LLM (see above table).

```yaml
models:
- name: full-runtime
Expand All @@ -34,6 +36,12 @@ models:
tools: auto # Use all default tools
```

Available tool groups:
- `auto`: All default tools (see above table).
- `memory`: Memory tools for storing and retrieving information across conversations.
#### Available tool groups

| Name | Description |
| ------------ | -------------------------------------------------------------------------------------------- |
| `auto` | All default tools (see above table) |
| `memory` | Memory tools for storing and retrieving information across conversations. |
| [`MCP`][mcp] | Tools provided from an MCP server. Can be run within Spice, or connected to over HTTP(s) SSE |

[mcp]: /docs/components/tools/mcp
109 changes: 109 additions & 0 deletions website/docs/components/tools/mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: 'Model Context Protocol Tools'
sidebar_label: 'MCP Tools'
---

Spice integrates with tools and services using the [Model Context Protocol](https://modelcontextprotocol.io/) (MCP). MCP tools can be configured to run internally or connect to external servers over HTTP using the Server-Sent Events (SSE) protocol.

## Overview

MCP helps extend the capabilities of the Spice runtime by enabling integration with external tools and services. This includes:

1. Running stdio-based MCP servers internally.
2. Connecting to external MCP servers over SSE.

## Configuring MCP Tools

To configure MCP tools, define them in the `tools` section of your `spicepod.yaml` file. The `from` field specifies the transport mechanism, such as `mcp:npx` for stdio-based tools or an HTTP URL for SSE-based tools.

### Example: Adding an MCP Tool (Stdio)

The following example demonstrates how to configure an MCP tool using `npx` to run a Google Maps MCP server:

```yaml
tools:
- name: google_maps
from: mcp:npx
params:
mcp_args: -y @modelcontextprotocol/server-google-maps
```

### Example: Connecting to an External MCP Server (SSE)

This example shows how to connect to an external MCP server over SSE:

```yaml
tools:
- name: external_mcp_server
from: mcp:http://example.com/v1/mcp/sse
```

## Using MCP Tools with Models

Once configured, MCP tools can be assigned to models via the `tools` parameter. For example:

```yaml
models:
- name: model_with_mcp
from: openai:gpt-4o
params:
tools: google_maps
```

## Spice as an MCP Server

Spice can also act as an MCP server, exposing its tools over SSE. This enables other Spice instances or external systems to connect and use the tools.

### Example: Connecting to Another Spice Instance via MCP

```yaml
tools:
- name: spice_instance
from: mcp:http://localhost:8090/v1/mcp/sse
```

## Configuration Options

### `from`

The `from` field specifies the transport mechanism for the MCP tool:

- **SSE**: Use an HTTP URL ending with `/sse` (e.g., `http://localhost:8090/v1/mcp/sse`).
- **Stdio**: Use commands like `mcp:npx` or `mcp:docker`. Additional arguments can be passed via `params.mcp_args`.

### `params`

The `params` field provides additional configuration for MCP tools. For stdio-based tools, use `mcp_args` to specify command-line arguments.

```yaml
tools:
- name: custom_tool
from: mcp:npx
params:
mcp_args: -y @custom/tool
```

### `env`

For stdio-based MCP tools, environment variables can be set using the `env` field.

```yaml
tools:
- name: tool_with_env
from: mcp:docker
env:
API_KEY: your_api_key
```

### `description`

The `description` field provides a textual description of the tool. This description is passed to any language model that uses the tool.

```yaml
tools:
- name: google_maps
from: mcp:npx
description: Provides geocoding and mapping capabilities.
```

For more details, see the [MCP Tools Reference](/docs/reference/spicepod/tools).
2 changes: 1 addition & 1 deletion website/docs/features/large-language-models/evals.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Evaluating Language Models'
sidebar_label: 'Evals'
description: 'Learn how Spice evaluates, tracks, compares, and improves language model performance for specific tasks'
sidebar_position: 3
sidebar_position: 4
pagination_prev: null
pagination_next: null
tags:
Expand Down
106 changes: 106 additions & 0 deletions website/docs/features/large-language-models/mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: 'Model Context Protocol (MCP)'
sidebar_label: 'MCP'
description: 'Learn how to use the Model Context Protocol (MCP) with Spice.'
sidebar_position: 2
pagination_prev: null
pagination_next: null
tags:
- models
- tools
- mcp
---

The Model Context Protocol (MCP) helps integrate external tools and services into the Spice runtime. MCP tools can be run internally or connected over HTTP using the Server-Sent Events (SSE) protocol.

![Spice.ai Open Source Model-Context-Protocol (MCP) support](/img/features/mcp.png)

## Overview

MCP enables Spice to:

1. Run stdio-based MCP servers internally.
2. Connect to external MCP servers over SSE.

This flexibility helps extend the capabilities of language models by providing access to external tools and services.

## Configuring MCP Tools

To configure MCP tools, define them in the `tools` section of your `spicepod.yaml` file. The `from` field specifies the transport mechanism (e.g., `mcp:npx` for stdio or an HTTP URL for SSE).

### Example: Adding an MCP Tool

```yaml
tools:
- name: google_maps
from: mcp:npx
params:
mcp_args: -y @modelcontextprotocol/server-google-maps
```

### Example: Connecting to an External MCP Server

```yaml
tools:
- name: external_mcp_server
from: mcp:http://example.com/v1/mcp/sse
```

## Using MCP Tools with Models

Once configured, MCP tools can be assigned to models via the `tools` parameter.

```yaml
models:
- name: model_with_mcp
from: openai:gpt-4o
params:
tools: google_maps
```

## Spice as an MCP Server

Spice can also act as an MCP server, exposing its tools over SSE. This enables other Spice instances or external systems to connect and use the tools.

### Example: Connecting to another Spice instance via MCP

```yaml
tools:
- name: spice_instance
from: mcp:http://localhost:8090/v1/mcp/sse
```

## Additional Configuration Options

### `from`

The `from` field specifies the transport mechanism for the MCP tool:

- **SSE**: Use an HTTP URL ending with `/sse` (e.g., `http://localhost:8090/v1/mcp/sse`).
- **Stdio**: Use commands like `mcp:npx` or `mcp:docker`. Additional arguments can be passed via `params.mcp_args`.

### `params`

The `params` field provides additional configuration for MCP tools. For stdio-based tools, use `mcp_args` to specify command-line arguments.

```yaml
tools:
- name: custom_tool
from: mcp:npx
params:
mcp_args: -y @custom/tool
```

### `env`

For stdio-based MCP tools, environment variables can be set using the `env` field.

```yaml
tools:
- name: tool_with_env
from: mcp:docker
env:
API_KEY: your_api_key
```

For more details, see the [MCP Tools Reference](/docs/components/tools/mcp).
2 changes: 1 addition & 1 deletion website/docs/features/large-language-models/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Language Model Memory'
sidebar_label: 'Memory'
description: 'Learn how to provide LLMs with memory'
sidebar_position: 2
sidebar_position: 3
pagination_prev: null
pagination_next: null
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Language Model Overrides'
sidebar_label: 'Parameter Overrides'
description: 'Learn how to override default LLM hyperparameters in Spice.'
sidebar_position: 4
sidebar_position: 5
pagination_prev: null
pagination_next: null
tags:
Expand Down
9 changes: 5 additions & 4 deletions website/docs/features/large-language-models/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ models:
```

### Example: Specifying tools via a Tool Group

```yaml
- name: full-runtime
from: openai:gpt-4o
params:
tools: auto # Use all default tools
- name: full-runtime
from: openai:gpt-4o
params:
tools: auto # Use all default tools
```

For details on tool groups, see [Tool Components](/docs/components/tools#tool-groups).
Expand Down
21 changes: 11 additions & 10 deletions website/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ sidebar_position: 0
title: Home
---

import ReactPlayer from 'react-player';
import ThemeBasedImage from '@site/src/components/ThemeBasedImage';
import ReactPlayer from 'react-player'
import ThemeBasedImage from '@site/src/components/ThemeBasedImage'

# Spice.ai Open Source

**Spice** is an open-source SQL query and AI compute engine, written in Rust, for data-driven apps and agents.

![Spice.ai Open Source Data Query & AI-Inference Compute Engine](/img/spice.ai-compute-engine.png)

Spice provides three industry standard APIs in a lightweight, portable runtime (single ~140 MB binary):
Spice provides four industry standard APIs in a lightweight, portable runtime (single ~140 MB binary):

1. **SQL Query APIs**: HTTP, Arrow Flight, Arrow Flight SQL, ODBC, JDBC, and ADBC.
2. **OpenAI-Compatible APIs**: HTTP APIs compatible the OpenAI SDK, AI SDK with local model serving (CUDA/Metal accelerated) and gateway to hosted models.
3. **Iceberg Catalog REST APIs**: A unified Iceberg Catalog API.
1. **SQL Query APIs**: Supports HTTP, Arrow Flight, Arrow Flight SQL, ODBC, JDBC, and ADBC.
2. **OpenAI-Compatible APIs**: Provides HTTP APIs for OpenAI SDK compatibility, local model serving (CUDA/Metal accelerated), and hosted model gateway.
3. **Iceberg Catalog REST APIs**: Offers a unified API for Iceberg Catalog.
4. **MCP HTTP+SSE APIs**: Enables integration with external tools via Model Context Protocol (MCP) using HTTP and Server-Sent Events (SSE).

:::tip[Goal 🎯]
Developers can focus on building data apps and AI agents confidently, knowing they are grounded in data.
Expand All @@ -34,7 +35,7 @@ Spice is primarily used for:

Spice 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 using DuckDB, Spice provides a simple, flexible, and production-ready engine you can just use.

<div style={{display: 'flex', justifyContent: 'center'}}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<ThemeBasedImage
width='600'
alt='OGP'
Expand All @@ -47,7 +48,7 @@ Spice is built-on industry leading technologies including [Apache DataFusion](ht

Spice makes it fast and easy to query data from one or more sources using SQL. You can co-locate a managed dataset with your application or machine learning model, and accelerate it with Arrow in-memory, SQLite/DuckDB, or with attached PostgreSQL for fast, high-concurrency, low-latency queries. Accelerated engines give you flexibility and control over query cost and performance.

<div style={{display: 'flex', justifyContent: 'center'}}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<ThemeBasedImage
width='800'
alt='Before Spice'
Expand Down Expand Up @@ -94,7 +95,7 @@ Spice simplifies building data-driven AI applications and agents by making it fa
| **Unified Data + AI Runtime** | ✅ | ― | ― | ― | ― |
| **Federated Data Query** | ✅ | ― | ― | ― | ― |
| **Accelerated Data Access** | ✅ | ― | ― | ― | ― |
| **Tools/Functions** | ✅ | ✅ | ✅ | Limited | Limited |
| **Tools/Functions** | ✅ (MCP HTTP+SSE) | ✅ | ✅ | Limited | Limited |
| **LLM Memory** | ✅ | ✅ | ― | ✅ | ― |
| **Evaluations (Evals)** | ✅ | Limited | ― | Limited | ― |
| **Search** | ✅ (VSS) | ✅ | ✅ | Limited | Limited |
Expand Down Expand Up @@ -136,7 +137,7 @@ Limited = Partial or restricted support

### Watch a quick BI dashboard acceleration demo

<div style={{display: 'flex', justifyContent: 'center', marginBottom: '15px'}}>
<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '15px' }}>
<ReactPlayer
controls
url='https://www.youtube.com/watch?v=t3B2AyshVY0&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=1&pp=gAQBiAQB'
Expand Down
4 changes: 4 additions & 0 deletions website/docs/reference/spicepod/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Optional. A textual description of the tool's function.

Optional. A map of key-value pairs for additional parameters specific to the tool.

### `env`

Optional. A map of key-value pairs of arbitrary environment variables to set when running the tool. Only useable if the tool requires a subprocess to run (e.g. MCP over stdio) .

### `dependsOn`

Optional. A list of dependencies that must be available before this tool can be used.
Binary file added website/static/img/features/mcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading