Repository navigation
MOD-20119: Lens developer docs - #4329
therealaditigupta wants to merge 9 commits into
Conversation
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>
|
|
🧠 Redis MemoryFound 9 related items from repository history (1 new this commit):
Memory updated at bb5e133 |
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>
mich-elle-luna
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| - **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`. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
| 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" />}} |
There was a problem hiding this comment.
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" />}} |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
| 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. |
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-sdksopenapi-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
redis-iris0.1.0a6 andredis-agent-lens0.1.0a2 packages.clients-examplereference resolves, and every internal link and anchor resolves.Open items
🤖 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 viaclients-example. Editor-only assets includelens/AGENTS.md,CLAUDE.md, andfor-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.