Skip to content

DOC-7113: Add a scripted Context Retriever interactive demo - #4105

Merged
paoloredis merged 10 commits into
mainfrom
DOC-7113
Sep 28, 2026
Merged

paoloredis merged 10 commits into
mainfrom
DOC-7113

Conversation

@paoloredis

@paoloredis paoloredis commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a browser-only demo page for Redis Context Retriever, to promote the Redis Iris GA. Sample data from a fictional food delivery app (customers, restaurants, orders) is stored as JSON keys. The reader edits the data model, watches the MCP tools regenerate, and then watches a scripted agent answer six questions over JSON-RPC tools/call. No service is called; results are computed in the browser from the sample data.

Tool names, argument schemas, and response envelopes copy what a live Context Retriever service returned. Relationship names and text/numeric conditions on the per-entity filter tool are modelled, not observed.

  • New page under develop/ai/context-engine/context-retriever, linked from the section overview.
  • New context-retriever-demo shortcode with its own JS and CSS.

Note

Low Risk
Static documentation and client-side demo assets only; no production services, auth, or data paths are modified.

Overview
Adds a browser-only interactive demo for Redis Context Retriever so readers can see how a data model becomes MCP tools before creating a Cloud service.

A new docs page embeds the context-retriever-demo Hugo shortcode, which loads scoped CSS/JS once per page. The widget walks through three steps—sample Redis JSON keys (food-delivery customers/restaurants/orders), an editable entity model that regenerates tool schemas when templates or field indexes change, and a scripted “agent” that replays six sample questions as JSON-RPC tools/call flows (computed in-memory; no real MCP service). The Context Retriever section overview now links to this page.

Core logic mirrors live tool names, argument shapes, and response envelopes; window.ContextRetrieverDemo exposes helpers for tests.

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

Adds a browser-only demo page for Redis Context Retriever, to promote the
Redis Iris GA. Sample data from a fictional food delivery app (customers,
restaurants, orders) is stored as JSON keys. The reader edits the data
model, watches the MCP tools regenerate, and then watches a scripted
agent answer six questions over JSON-RPC tools/call. No service is
called; results are computed in the browser from the sample data.

Tool names, argument schemas, and response envelopes copy what a live
Context Retriever service returned. Relationship names and text/numeric
conditions on the per-entity filter tool are modelled, not observed.

- New page under develop/ai/context-engine/context-retriever, linked
  from the section overview.
- New context-retriever-demo shortcode with its own JS and CSS.

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

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7113

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 13 related items from repository history:

Memory updated at c705253

@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.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/js/context-retriever-demo.js Outdated
Comment thread static/js/context-retriever-demo.js
…ross tabs

- ts() treated an explicit hour of 0 as missing and used noon, so the
  "this month" bounds ran noon to noon. Only a missing hour now
  defaults to noon.
- The Ask panel was rebuilt on every visit, which dropped the chat and
  left the question buttons dead until an orphaned replay finished. It
  is now built once, so a replay keeps playing across tab switches;
  returning reconnects only when the data model changed the tools.

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

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/js/context-retriever-demo.js
get_*_by_id returned a not-found object, and the scripted agent read
.name from it, so editing a key template to match no keys produced
answers like "from undefined". A missing record now fails the call as a
tool error (result with isError: true, the shape the live server uses
for failed lookups), and the agent says which lookup failed and points
at that entity's key template.

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

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/css/context-retriever-demo.css Outdated
The button/select/input reset (font and color: inherit) had higher
specificity than single-class rules, so the red CTA buttons rendered
dark ink on red at 15px, and tabs, sub-tabs, chips, and selects lost
their sizes and colors. The reset is now wrapped in :where() so it has
zero specificity; computed styles checked in the browser now match
the intended values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mich-elle-luna

Copy link
Copy Markdown
Collaborator

Thank you! This is really cool 💟

@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 requested a review from a team September 24, 2026 17:17
@paoloredis

Copy link
Copy Markdown
Collaborator Author

Comment thread static/js/context-retriever-demo.js Outdated
The "Behind the scenes" panel added INDEXMISSING to every indexed field,
while its note said only the index names were illustrative. The live
service varies the options by field type, so the panel now does too:

- TAG fields: TAG INDEXMISSING
- NUMERIC fields: NUMERIC SORTABLE
- TEXT fields: plain TEXT

The note now says tag fields are the ones that use INDEXMISSING, so the
Redis 7.4 requirement still holds, and that tag fields used for access
control also get INDEXEMPTY, which the demo doesn't include.

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

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/js/context-retriever-demo.js Outdated
To list Maya's orders by date, the scripted agent sorted the
filter_order result in place. That array is also what the tools/call
card shows as the tool's response, so the card showed the orders in date
order (o3018 before o3003) instead of the order the tool returned. The
answer now sorts a copy, as the diet question already did. A check over
all six questions confirms none of them changes a stored tool result.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e55827f. Configure here.

Comment thread static/js/context-retriever-demo.js Outdated
paoloredis and others added 4 commits September 28, 2026 12:18
The badge counted every key a template matched, but queries and the
generated FT.CREATE ... ON JSON index only use JSON documents. Pointing a
template at cart:u104 (a hash) showed a green match, then lookups and
filters returned nothing. The badge now counts JSON documents only, and a
template that matches only other key types shows "Matches 1 key, but not
JSON" in red, with a tooltip that Context Retriever only reads JSON.
Also fixes "Matches 1 keys".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Editing a key template kept the entity's fields, so pointing Customer at
cart:u104 still listed the eight customer fields, which describe
documents the template no longer reaches. Changing a template now
re-detects the fields from the JSON documents it matches, as Auto-detect
fields does in the console: restaurant:{id} gives restaurant fields, and
a template that matches no JSON documents gives none, so the entity gets
no tools. Index edits are kept per document type, so switching the
template back restores them. If the agent needs a tool that no longer
exists, it now says the entity has no fields instead of blaming an index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An edited key template stayed in place after switching to another
entity, so coming back to Customer still showed cart:{id} and no fields.
Switching sub-tabs now puts the template of the entity being left back to
its default, with its default fields. Index choices made on the entity's
own documents are kept; anything set while the template pointed at other
documents is dropped. Going to the Ask step keeps the edit, so readers
can still see what a broken template does to the agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resetting a template whenever the reader switched entities undid the
point of editing it: a changed or broken template is how readers see
what it does to the agent's answers. Edits now stay across sub-tab and
step switches. A Reset button next to the template, shown only while it
differs from the default, puts it back with its default fields. Index
choices made on the entity's own documents are kept, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paoloredis
paoloredis merged commit 9cad0b4 into main Sep 28, 2026
98 of 99 checks passed
@paoloredis
paoloredis deleted the DOC-7113 branch September 28, 2026 12:50
EliShteinman added a commit to EliShteinman/docs that referenced this pull request Sep 29, 2026
Adds a browser-only Context Retriever interactive demo page with its own shortcode, JS and CSS.
EliShteinman added a commit to EliShteinman/docs that referenced this pull request Sep 29, 2026
Adds a browser-only Context Retriever interactive demo page with its own shortcode, JS and CSS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants