<a id="real-time-context-engine"></a>

# Real-Time Context Engine in Confluent Cloud

The Real-Time Context Engine is a fully managed feature in Confluent Intelligence that
delivers real-time context from your Apache Kafka® topics to AI agents. You
can enable the Real-Time Context Engine on topics that have a registered schema and
meet the cluster and region requirements, and your agents can
immediately query the most current data through the Model Context
Protocol (MCP).

## Demo: Querying a topic for live data

In this demo, you ask Claude Code questions about a live logistics
fleet in natural language. Claude Code connects to the Real-Time Context Engine through
MCP. It discovers the available topics, inspects their schemas, and
queries the latest data to answer each question. For example, you ask
which driver is on an active route and whether any fragile packages
are in transit. Because the Real-Time Context Engine serves the most current state of
each Kafka topic, the answers reflect live data.

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px;">
   <iframe src="https://www.youtube.com/embed/8YJa22DEchg" title="Demo: Querying a Kafka topic for live data with Claude Code" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

## How the Real-Time Context Engine works

When you enable the Real-Time Context Engine on a Kafka topic, Confluent Cloud materializes the
topic data into a table in a low-latency data-serving layer that
Confluent Cloud optimizes for fast lookups. The Real-Time Context Engine continuously ingests
new data from the topic so that this table always reflects the latest
state. AI agents access the data through MCP tools without interacting
directly with Kafka.

![Real-Time Context Engine data flow](ai/real-time-context-engine/images/realtime-context-engine.svg)

The Real-Time Context Engine is fully managed. You don’t need to provision
infrastructure, write Kafka consumers, or manage Apache Flink® jobs. You
enable the Real-Time Context Engine on a topic, and your agents can start querying data
immediately.

## Key capabilities

- **Flexible query support**: Query data using key lookups, filters,
  ranges, and predicates with compound logic. For more information, see
  [Query Data](query-data.md#rtce-query-data).
- **Role-based access control**: Control who can enable topics and
  who can query data by using Confluent Cloud RBAC roles. For more
  information, see
  [Access Control](access-control.md#rtce-access-control).
- **Audit logging**: Track all access to the Real-Time Context Engine for compliance
  and governance. For more information, see
  [Auditable Events](../../monitoring/audit-logging/event-methods/real-time-context-engine.md#rtce-auditable-events).
- **Usage-based billing**: Pay only for the compute and storage you
  use, with no infrastructure to provision or scale manually. For more
  information, see [Billing](billing.md#rtce-billing).

## Supported cluster types and regions

The Real-Time Context Engine is available on Basic, Standard,
Enterprise, and Dedicated clusters on AWS.

For the current list of supported regions, see
[Cloud Regions](../../get-started/regions.md#providers-regions).

## Relationship to other Confluent MCP servers

The Real-Time Context Engine exposes data to AI agents through an MCP server
that focuses on delivering real-time business data from
your Kafka topics. Confluent also provides
[other MCP servers](../ai-tools/overview.md#ai-tools-overview) for a different
purpose: letting AI assistants manage Confluent resources
like environments, clusters, topics, and connectors.

The two are complementary. Use the other Confluent
MCP servers to set up and monitor your Confluent Cloud infrastructure,
and the Real-Time Context Engine to connect your AI applications to the data
flowing through that infrastructure.

## Append and upsert modes

The Real-Time Context Engine ingests data in one of two modes, which determines what
your agents can query through MCP:

- **Append mode** (default): The Real-Time Context Engine ingests every record from the
  topic, so your agents can query all of the topic’s records. This
  mode suits event logs and other immutable data.
- **Upsert mode**: The Real-Time Context Engine keeps only the latest record for each
  key, so your agents query the current state of each key rather than
  its full history. This mode suits stateful entities, such as
  customer profiles, inventory, or order status.

The Real-Time Context Engine selects the mode automatically based on the topic’s
[cleanup.policy](../../topics/manage.md#topics-cleanup-policy). For how to configure a
topic for upsert mode, along with its requirements and limitations,
see [Upsert mode](limitations.md#rtce-upsert-mode).

## Related content

- [Get Started](get-started.md#rtce-get-started)
- [Billing](billing.md#rtce-billing)
- [Use AI Tools with Confluent Cloud](../ai-tools/overview.md#ai-tools-overview)
- [Streaming Agents](../streaming-agents/overview.md#ai-streaming-agents-overview)
- [Tool Management](../../flink/reference/statements/create-tool.md#flink-sql-create-tool)
- [AI_RUN_AGENT Function](../../flink/reference/functions/model-inference-functions.md#flink-sql-ai-run-agent-function)

#### NOTE
This website includes content developed at the [Apache Software Foundation](https://www.apache.org/)
under the terms of the [Apache License v2](https://www.apache.org/licenses/LICENSE-2.0.html).
