Fast, secure data
access for agents

Spice is a data layer between AI agents and your databases, warehouses, and APIs. Agents query over MCP or SQL. Spice keeps an isolated, accelerated copy of the tables that you choose and federates queries for the rest. Spice can keep each copy current with change data capture (CDC), and queries on accelerated data stay off production.

Diagram of three AI agents, each connected through its own Spice.ai instance to a shared data store that spans Databricks, PostgreSQL, Snowflake, and S3

Fast, current data at agent scale

31x

faster than querying object storage directly (TPC-H SF-100, one node)

566K

rows per second of initial ingest from PostgreSQL, before CDC takes over (CH-benCHmark SF-1000)

2.9x

faster on three nodes than one as agent workloads grow (TPC-H SF-100)

Built for how agents use data

Agents query often, in bursts, and across many sources. Spice gives each agent fast, scoped, and audited access to the data it needs. Spice stays simple to operate from one deployment to thousands.

Real-time analytics

Analytical query on operational data

Spice replicates the operational data an agent needs into an isolated analytics replica. CDC keeps the replica current, so agent queries stay off the production database.

Read the CDC docs (opens in a new tab)

Real-time analytics on operational data: an app writes to MySQL, an isolated Spice analytics replica is added beside it, CDC streams each change into the replica, and agents' heavy analytical queries run on Spice without touching MySQLisolatedCDCMySQLanalytics replicaAppAgent 1Agent 2Real-time analytics on operational data
Query without ETL

Data access without ETL

Spice federates databases, warehouses, object storage, and APIs into one SQL layer. Agents call SQL, hybrid search, schema discovery, and your MCP servers through one authenticated MCP endpoint.

Read the federation docs (opens in a new tab)

Isolated agent data

Physical isolation

Each agent queries a Spice runtime that holds only the datasets its Spicepod declares. Datasets are read-only by default. The agent holds a Spice API key, not database credentials.

Read the authentication docs (opens in a new tab)

Per-tenant lakehouses

One standard lakehouse for every tenant

Spice standardizes lakehouse deployments for every tenant, so adding a customer is a configuration change instead of managing additional data infrastructure.

Read about isolated agent data stacks

Tool access and audit

Controls and audit on every call

The tools parameter sets which tools a model that Spice runs can call. Set it to a list of tool names to limit them. The tool_recursion_limit parameter caps tool-call rounds for each request, 10 by default. Task history records each SQL query, model call, and tool call.

Read the tools docs (opens in a new tab)

Connect an agent to your data

MCP example

An example of connecting an agent to Spice through MCP.

# spicepod.yamlruntime:  auth:    api_key:      enabled: true  # /v1/mcp requires auth      keys:        - ${secrets:SPICE_API_KEY}datasets:  - from: postgres:public.orders    name: orders    params:      pg_host: db.example.com      pg_pass: ${secrets:PG_PASS}    acceleration:      enabled: true  # A local, accelerated copy for agents  - from: snowflake:DB.SALES.DEALS    name: deals  # A warehouse table, credentials omitted for simplicity$ claude mcp add --transport http spice \    http://localhost:8090/v1/mcp \    --header "X-API-KEY: <key>"sql> -- the agent calls the sql tool over MCP     SELECT o.status, COUNT(*) AS orders,       d.stage AS deal_stage     FROM orders o            -- Postgres     JOIN deals d             -- Snowflake       ON d.customer_id = o.customer_id     WHERE o.customer_id = 42     GROUP BY o.status, d.stage;# example outputshipped    18  negotiationpending     3  negotiation
  1. Connect and accelerate your data

    Define each dataset in spicepod.yaml and set acceleration to enabled.

  2. Run Spice next to your agents

    Start Spice with spice run, or deploy it as a sidecar, in your cluster, or on Spice Cloud.

  3. Query from any client

    Agents call Spice over MCP, SQL over HTTP, Arrow Flight, JDBC, ODBC, or the OpenAI-compatible API.

  1. /plugin marketplace add spiceai/skills
  2. /plugin install spiceai@spiceai

Proven in production

Teams run Spice to serve fast data to apps and agents at scale.

Peter Janovsky

“Spice opened the door to take these critical control-plane datasets and move them next to our services in the runtime path.”

Peter Janovsky

Software Architect, Twilio

Darin Douglass

100x

Faster queries

“It just spins up and works, which is really nice. The responsiveness is amazing, which is a huge gain for the customer.”

FAQs

Answers for teams that connect AI agents to operational data.

Agent data serving is a data layer between AI agents and your databases, warehouses, and APIs. Agents query a Spice runtime over MCP or SQL, with a Spice API key instead of database credentials. Spice keeps an accelerated local copy of the tables that you choose and federates queries for the others.

Not by default. Each dataset defaults to access: read, so the sql tool rejects INSERT, UPDATE, DELETE, and DDL statements. A write needs a read-write API key and a dataset set to access: read_write.

Not for accelerated datasets: agents query the local copy in Spice, not the source. With CDC, Spice reads only the source change log after the initial snapshot. In the Spice 2.0 CH-benCHmark run, PostgreSQL kept more than 266,000 transactions per minute (tpmC) while Spice ran analytical queries. Federated datasets still query the source, so read SQL federation and acceleration to choose a mode for each table.

An accelerated dataset that uses CDC is about 2 seconds behind the source under load. By default, a PostgreSQL, MySQL, or DynamoDB CDC dataset reports ready only when its replication lag is below 2 seconds. A federated dataset reads the source at query time, unless the SQL results cache (on by default) already holds the result. To set up a replica, read Analytics Replica.

Yes. The Spice runtime is open source under the Apache 2.0 license and includes the MCP endpoint, CDC, and acceleration. Spice Cloud runs it as a managed service. Spice.ai Enterprise adds Cedar authorization policies for datasets, models, and tools, and OIDC authentication in preview.

For a self-hosted runtime, configure an API key in runtime.auth, then add the Spice /v1/mcp endpoint to the client. The endpoint rejects every request until runtime.auth is configured.

runtime:
  auth:
    api_key:
      enabled: true
      keys:
        - ${secrets:SPICE_API_KEY}
  mcp:
    allowed_hosts:
      - spice.internal.example.com # The host name that a remote client uses

By default, a self-hosted runtime listens on 127.0.0.1:8090, and the endpoint accepts only the localhost, 127.0.0.1, and ::1 hosts. For a client on another host, start Spice with --http set to an address that the client can reach. Then add its host name to allowed_hosts. Before a remote client sends the key in the X-API-KEY header, turn on TLS in runtime.tls or keep the endpoint on a private network.

On Spice Cloud, add https://<project-cname>.spiceai.io/v1/mcp to the client with a project API key in the X-API-Key header. Spice Cloud adds the project host name to allowed_hosts when it deploys the project, so this path needs no runtime.mcp config. For the client commands, read the Spice Cloud MCP API docs.

The /v1/mcp endpoint lists the Spice built-in tools and each tool that the Spicepod adds. The built-in tools include these:

  • list_datasets lists the datasets that the agent can query, with their descriptions and columns.
  • table_schema reads column names and types before the agent writes SQL.
  • sql runs a query and returns JSON rows.
  • search runs semantic search on datasets that have embeddings.
  • get_current_datetime gives the current time for date filters.

To limit what an external MCP client can query, declare only the needed datasets in the Spicepod of its runtime. For agents that need different tables, run a separate runtime with its own API keys for each one. For a model that Spice runs, list the allowed datasets in the datasets field of the model, which scopes its built-in tools. To call another MCP server through Spice, add it as a tool with its address, such as from: mcp:https://mcp.example.com/mcp.

Query the runtime.task_history table. Task history is on by default and records each SQL query, model call, and tool call with its input. Calls through /v1/mcp to other MCP servers are recorded the same way.

SELECT start_time, task, input, error_message
FROM spice.runtime.task_history
WHERE task LIKE 'tool_use::%'
ORDER BY start_time DESC
LIMIT 20;

To also record each output, set captured_output: truncated under runtime.task_history. Spice keeps records for 8 hours by default, and retention_period changes this limit.