{
  "schema_version": 2,
  "id": "develop/ai/context-engine/context-retriever",
  "title": "Redis Context Retriever",
  "url": "https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/",
  "summary": "Expose tools to Agents to query your Redis databases.",
  "tags": [
    "docs",
    "develop",
    "ai"
  ],
  "last_updated": "2026-10-05T20:57:56-07:00",
  "children": [
    {
      "id": "develop/ai/context-engine/context-retriever/concepts",
      "summary": "Learn how Context Retriever's governed tool-calling differs from giving application code direct database access.",
      "title": "Context Retriever concepts",
      "url": "https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/concepts/"
    },
    {
      "id": "develop/ai/context-engine/context-retriever/quickstart",
      "summary": "Model a data source, generate MCP tools, and call them from an agent using the ctxctl CLI.",
      "title": "Redis Context Retriever quickstart",
      "url": "https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/quickstart/"
    },
    {
      "id": "develop/ai/context-engine/context-retriever/interactive-demo",
      "summary": "See how Context Retriever turns the keys in a Redis database into MCP tools that an agent calls to answer questions.",
      "title": "Context Retriever interactive demo",
      "url": "https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/interactive-demo/"
    }
  ],
  "page_type": "content",
  "content_hash": "1c7f0e6dba8aa5abcdbf2a8878628c59c51725fbdd80e40ed7c939c87703e2cf",
  "sections": [
    {
      "id": "overview-1",
      "title": "Overview",
      "role": "overview",
      "text": "Give your agents structured, governed access to business data, without building custom tools for every project.\n\nContext Retriever lets you define your data model once. It automatically generates the retrieval tools agents call at runtime, so agents always work with accurate, live data through a controlled interface rather than guessing at SQL or calling databases directly.\n\n<div class=\"grid grid-cols-1 md:grid-cols-4 gap-6 my-8\">\n  \n  \n  \n  \n</div>"
    },
    {
      "id": "what-is-context-retriever",
      "title": "What is Context Retriever?",
      "role": "content",
      "text": "Redis Context Retriever is a schema-first context layer for AI agents that:\n\n- **Defines business context once**: Model your entities, fields, and relationships in one place, reused across all agents\n- **Auto-generates retrieval tools**: Tools are created from your data model, not hand-coded per agent\n- **Keeps agents out of your database**: Agents call generated tools; the system handles data access safely\n- **Governs access by design**: Each agent key has access tags that automatically filter what data it can see\n- **Exposes tools via MCP**: Agents call tools through a standard Model Context Protocol (MCP) interface at runtime"
    },
    {
      "id": "why-use-context-retriever",
      "title": "Why use Context Retriever?",
      "role": "content",
      "text": "<div class=\"grid grid-cols-1 md:grid-cols-2 gap-6 my-6\">\n  <div class=\"p-5 border border-redis-pen-300 rounded-lg\">\n    <h3 class=\"text-redis-ink-900 font-semibold mb-3\">For AI applications</h3>\n    <ul class=\"space-y-1 text-redis-pen-600\">\n      <li>Agents reliably follow defined data paths instead of guessing at SQL</li>\n      <li>Live, structured context from your business data at every agent step</li>\n      <li>No tool zoo sprawl: one model definition, consistent tool surface</li>\n      <li>Access control built in: agents only see what they're allowed to see</li>\n    </ul>\n  </div>\n  <div class=\"p-5 border border-redis-pen-300 rounded-lg\">\n    <h3 class=\"text-redis-ink-900 font-semibold mb-3\">For developers</h3>\n    <ul class=\"space-y-1 text-redis-pen-600\">\n      <li>Python client and <code>ctxctl</code> CLI for modeling and deploying</li>\n      <li>UI-based setup available in Redis Cloud console</li>\n      <li>No per-agent tool engineering: the platform handles tool generation</li>\n      <li>Available fully managed on Redis Cloud or self-managed on your own infrastructure</li>\n    </ul>\n  </div>\n</div>"
    },
    {
      "id": "quick-example",
      "title": "Quick example",
      "role": "content",
      "text": "Install the Python client, which also includes the `ctxctl` CLI:\n\n[code example]\n\nUse the `ctxctl` CLI, the Python client, or the Redis Cloud UI to model your entities and relationships. Context Retriever uses that model to automatically generate retrieval tools that agents call at runtime through its MCP interface. Agents never access your database directly.\n\nSee the [Redis Cloud setup guide](https://redis.io/docs/latest/operate/iris/context-retriever/create-service) to create your first Context Retriever service, or follow the [quickstart](https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/quickstart) for a full CLI walkthrough: model entities, generate tools, and call one as an agent would.\n\nTo see how a data model becomes tools before you create a service, try the [interactive demo](https://redis.io/docs/latest/develop/ai/context-engine/context-retriever/interactive-demo).\n\nRedis Context Retriever helps teams expose operational context to AI agents through schema-first retrieval. It models the entities, fields, keys, and relationships that matter to an agent workflow, then presents that context through a governed tool surface the agent can call at runtime. Context Retriever helps an AI Agent understand what business objects exist, how they connect, and which paths are safe to use."
    },
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Production agents fail not because the model is wrong, but because the context layer breaks. Enterprise data can be fragmented across multiple different databases, and can be disorganized. Teams try to patch this with text-to-SQL, OpenAPI-to-MCP wrappers, or hand-built tools, which works for demos but creates tool zoo sprawl, SQL risk, and agents that can't reliably choose the right path in production. Redis Context Retriever gives teams a governed, schema-first surface agents can traverse safely.\n\nWhen you set up Redis Context Retriever, you model the objects that matter to your agent workflow and connect the relationships between them. You can do this either through the UI, using the [Context Surfaces Python Client](https://pypi.org/project/redis-context-retriever/), or the `ctxctl` CLI (available when you install the python client). Context Retriever will use those relationships to automatically create and deploy retrieval tools from your entity model.  \n\nWhen an agent needs context during execution, it calls the MCP tools Context Retriever exposes. Instead of guessing which tool to use, or generating SQL, the agent follows the defined entity paths and gets back structured, live, operational context."
    },
    {
      "id": "get-started-with-redis-context-retriever",
      "title": "Get started with Redis Context Retriever",
      "role": "content",
      "text": "Get started with Redis Context Retriever on Redis Cloud or join the private preview for Redis Software.\n\n**Redis Cloud:**\n\nTo set up a Redis Context Retriever on Redis Cloud, you need a database on Redis Cloud that already has relevant data. If you use a relational database, use [Redis Data Integration (RDI)](https://redis.io/docs/latest/operate/rc/rdi) to ingest data into a Redis Cloud database.\n\nWhen you have a database, [Create a context retriever service](https://redis.io/docs/latest/operate/iris/context-retriever/create-service) for your database on Redis Cloud.\n\nAfter you set up Context Retriever, you can [view your service](https://redis.io/docs/latest/operate/iris/context-retriever/view-service). See the [Context Surfaces Python Client](https://pypi.org/project/redis-context-retriever/) for more information on how to call your tools.\n\n**Redis Software (private preview):**\n\nRedis Context Retriever is available for self-managed deployment on Kubernetes as a private preview. See [Install Context Retriever](https://redis.io/docs/latest/operate/iris/context-retriever/self-managed).\n\nYou need a license key to deploy: [contact Redis](https://redis.io/contact/) to request access."
    }
  ],
  "examples": [
    {
      "id": "quick-example-ex0",
      "language": "bash",
      "code": "pip install redis-context-retriever",
      "section_id": "quick-example"
    }
  ]
}
