Skip to content

MOD-20119: Lens developer docs - #4329

Open
therealaditigupta wants to merge 9 commits into
iris-ga-docsfrom
MOD-20119-iris-lens-developer-docs
Open

therealaditigupta wants to merge 9 commits into
iris-ga-docsfrom
MOD-20119-iris-lens-developer-docs

Conversation

@therealaditigupta

@therealaditigupta therealaditigupta commented Oct 23, 2026 •

Copy link
Copy Markdown

MOD-20119: customer-facing developer documentation for Lens, the Redis Iris observability product for AI agents.

Draft. It will be marked ready for review when publication is approved.

In this PR

  • content/develop/ai/context-engine/lens/: ten pages: landing page, concepts, quickstart, instrument an agent, agent integration, inspect sessions, configure, read API, limits and errors, and the API reference.
  • content/develop/ai/context-engine/lens/api-reference/openapi.json: the published read API contract, copied unchanged from iris-sdks openapi-lens.json.
  • local_examples/iris/lens/: eleven example sets, rendered as Python (Iris) and cURL (Iris) tabs.
  • static/images/ai/context-engine/lens-how-it-works.svg, lens-turn.svg: two diagrams.
  • content/develop/ai/context-engine/_index.md: a Lens tile.
  • content/develop/ai/context-engine/lens/AGENTS.md: Lens terminology, disclosure, and framing rules for AI-assisted editing (not published).
  • for-ais-only/lens-docs-design.md: the section design and remaining work (not published).

Verification

  • Every SDK call and response field used in the examples was checked against the published redis-iris 0.1.0a6 and redis-agent-lens 0.1.0a2 packages.
  • Instrumentation examples were run against a local ingest stand-in. Model calls and Iris product services were stubbed, and each example exported the expected steps under one turn.
  • Read API examples (Python and cURL) were run against a fake read API covering all six operations, including pagination.
  • All example sets parse with the repo's example processor, every clients-example reference resolves, and every internal link and anchor resolves.
  • An independent accuracy review against the service, SDK, and UI source and an independent reader review were applied.
  • Not yet run against a live Lens instance, and the site build hasn't been run locally.

Open items

  • Operator handoffs are marked with TODO comments until the operator docs (MOD-18980) land.
  • The published read API contract contains some internal wording in field descriptions; to be fixed at the source.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and static assets only; no application runtime, auth, or data-path code changes.

Overview
Adds customer-facing developer documentation for Lens (Redis Iris agent observability) under content/develop/ai/context-engine/lens/, and surfaces it from the context engine index with a new Lens tile.

The new section covers tracing and debugging agent turns end to end: concepts, quickstart, instrumentation (redis_iris.lens), framework integration (LangGraph, OpenAI Agents SDK, Google ADK, custom loops), UI inspection, configuration, read API usage (redis-agent-lens), limits/errors, and a generated read API reference backed by a copied OpenAPI contract. Two SVG diagrams illustrate how tracing flows and what a turn records.

Runnable tabbed examples live in local_examples/iris/lens/ (eleven sets, Python and cURL) and are wired into pages via clients-example. Editor-only assets include lens/AGENTS.md, CLAUDE.md, and for-ais-only/lens-docs-design.md; operator handoffs are left as TODO comments until operator docs exist.

Reviewed by Cursor Bugbot for commit bb5e133. Bugbot is set up for automated code reviews on this repo. Configure here.

therealaditigupta and others added 6 commits October 22, 2026 18:25
Plan the customer-facing Lens developer docs under
content/develop/ai/context-engine/lens/: decisions, sources, the
page-by-page structure, example sets, validation, reviewers, and
remaining work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n in the Lens docs design

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the Lens conventions file, the concepts page, the quickstart, and its
Python example. The example's export and read steps were checked against
a local ingest sink and a fake read API; a live-instance run is still to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the quickstart example under local_examples/iris/ so it renders as
Python (Iris), and add a cURL (Iris) source for reading the turn back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 9 related items from repository history (1 new this commit):

Memory updated at bb5e133

therealaditigupta and others added 3 commits October 22, 2026 18:49
Add the Lens landing page, instrument, agent integration, inspect
sessions, configure, read API, limits, and API reference pages; their
example sets; two diagrams; and the Lens tile on the context engine index.
Examples were checked against a local ingest stand-in or a fake read API,
with model and Iris product calls stubbed; no live-instance run yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accuracy: the attach example now reaches its write-back (END edge), the
quickstart names the UI's real step labels, a turn needs an agent ID,
init() and shutdown() return values are described as they behave, strict
mode only covers session IDs, include() is only for spans outside a turn
or dropped scopes, UI search covers loaded sessions, read example guards
empty results, and the ingest error table matches the SDK's warnings.

Reader: lead the landing page with what Lens shows, move the cross-product
example first, make init() usage explicit, add missing-step
troubleshooting and how to see SDK warnings, remove duplicated text, and
expand acronyms at first use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@therealaditigupta
therealaditigupta marked this pull request as ready for review October 23, 2026 10:05
@mich-elle-luna mich-elle-luna added the iris Iris context engine docs label Oct 23, 2026
@mich-elle-luna mich-elle-luna self-assigned this Oct 23, 2026

@mich-elle-luna mich-elle-luna left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@mich-elle-luna mich-elle-luna left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditi,
Thank you for this draft, it is looking good. Here are some suggestions to improve clarity in a couple of areas.

- **Model calls traced automatically:** Calls through OpenAI, Anthropic, Amazon Bedrock, and LangChain clients appear with their prompts, completions, and token counts.
- **Built on OpenTelemetry:** Lens joins the tracer your application already uses, and Iris product steps reach your existing observability tools as well.
- **You control content capture:** Capture prompts and retrieved text for debugging, or keep only IDs, hashes, and counts.
- **Background export:** Your agent doesn't wait on Lens, and a failed export doesn't raise into your agent.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Background export:** Your agent doesn't wait on Lens, and a failed export doesn't raise into your agent.
- **Background export:** Lens exports in the background, so your agent never waits for it. If an export fails, the error stays out of your agent's code.

weight: 20
---

Open one Lens turn around each agent run, and the steps inside it join the turn. These examples need the Lens connection values from the [quickstart](/content/develop/ai/context-engine/lens/quickstart.md#configure-the-sdk). The framework examples also need a model provider key, such as `OPENAI_API_KEY`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Open one Lens turn around each agent run, and the steps inside it join the turn. These examples need the Lens connection values from the [quickstart](/content/develop/ai/context-engine/lens/quickstart.md#configure-the-sdk). The framework examples also need a model provider key, such as `OPENAI_API_KEY`.
To trace an agent run in Lens, open a turn around it. Each step the agent takes inside the run, such as a memory recall or a model call, is recorded in that turn. For more about turns and steps, see [Lens concepts](/content/develop/ai/context-engine/lens/concepts.md).
Before you start, get the Lens connection values from the [quickstart](/content/develop/ai/context-engine/lens/quickstart.md#configure-the-sdk). The framework examples also need a model provider key, such as `OPENAI_API_KEY`.


## Trace one turn across Iris products

When your agent uses Agent Memory, Agent Playbooks, and Context Gateway, one Lens turn shows how each shaped the answer. This example needs the connection values for each Iris product.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When your agent uses Agent Memory, Agent Playbooks, and Context Gateway, one Lens turn shows how each shaped the answer. This example needs the connection values for each Iris product.
When your agent uses Agent Memory, Agent Playbooks, and Context Gateway, a single Lens turn shows how each Iris product contributed to the agent's response. This example needs the connection values for each Iris product.


`workflows.turn()` runs each product's context step before the model and its write-back after. Every product call joins the turn:

{{< clients-example set="iris_lens_iris_products" step="iris_products_turn" description="" lang_filter="Python (Iris)" footer="hide" />}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see why you are using 'products', we are calling these services in the rest of the docs, so maybe if we define the term 'products' it will be more clear.


Wrap the handler for one message in `lens.turn()`, and set the outcome on each path:

{{< clients-example set="iris_lens_own_loop" step="own_loop_turn" description="" lang_filter="Python (Iris)" footer="hide" />}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should add a line after this example describing what it does. Also probably add a section here with links to next steps?

- docs
- develop
- ai
description: Debug agent answers by tracing the context behind each turn, from retrieval to prompt.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Debug agent answers by tracing the context behind each turn, from retrieval to prompt.
description: Debug AI agent answers by tracing the context behind each turn, from retrieval to prompt.


## What is Lens?

Lens shows why your AI agent answered the way it did. For each turn, it records what each source returned, what entered the prompt, which model and tool calls ran, how long each step took, and how the turn ended.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Lens shows why your AI agent answered the way it did. For each turn, it records what each source returned, what entered the prompt, which model and tool calls ran, how long each step took, and how the turn ended.
## What is Lens?
Lens is a Redis Iris observability tool that traces your AI agent's turns. A turn is one agent exchange, such as answering a single message. For each turn, Lens records what each source returned, such as a memory recall or a retrieval, and what entered the prompt. It also records which model and tool calls ran, how long each step took, and how the turn ended.
When your agent gives a wrong answer, Lens shows where it went wrong. For example, you might see that the right memory was recalled but dropped from the prompt, or that a retrieval came back empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iris Iris context engine docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants