Skip to content

Python: Align Redis context sample guide with current APIs - #9446

Open
LI (ktz03) wants to merge 2 commits into
microsoft:mainfrom
ktz03:docs/redis-context-guide-current-api
Open

LI (ktz03) wants to merge 2 commits into
microsoft:mainfrom
ktz03:docs/redis-context-guide-current-api

Conversation

@ktz03

Copy link
Copy Markdown
Contributor

Motivation & Context

The Redis context-provider sample guide still documents removed configuration names and the old invoking hook. Its optional OpenAI-key instructions also conflict with examples that instantiate OpenAITextVectorizer.

Description & Review Guide

  • What are the major changes? Align one sample README with redis_vectorizer, overwrite_index, the before_run/after_run hooks, and the existing examples' embedding prerequisites. Distinguish context retrieval from complete conversation-history persistence.
  • What is the impact of these changes? Documentation only. Full-text and hybrid constructor/schema configurations were checked locally, together with the eight constructor calls in the three unchanged context samples. Live Redis, OpenAI/Foundry calls and the full sample suite were not run.
  • What do you want reviewers to focus on? Whether the configuration and setup instructions accurately match the existing provider and examples.

Related Issue

N/A - trivial change: correct stale API names and setup instructions in one README; no runtime or public API changes.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Documentation, API checks, and PR description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" in the title prefix).

Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:14
@ktz03
LI (ktz03) deployed to github-app-auth October 16, 2026 08:14 — with GitHub Actions Active
@ktz03
LI (ktz03) deployed to github-app-auth October 16, 2026 08:14 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The prerequisites still omit an embedding-dependent scenario, leaving readers without setup instructions needed to run it.

2 open findings
What changed in this PR

Updates the Redis context-provider sample guide to match current APIs and embedding requirements. No runtime code changes.

Changes:

  • Replaces obsolete configuration names and lifecycle hooks.
  • Clarifies OpenAI embedding prerequisites.
  • Distinguishes context retrieval from complete conversation-history persistence.
File Description
python/​samples/​02-agents/​context_providers/​redis/​README.md Updates API guidance, setup requirements, and sample descriptions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

| [`azure_redis_conversation.py`](azure_redis_conversation.py) | Demonstrates conversation persistence with RedisHistoryProvider and Azure Redis with Azure AD (Entra ID) authentication using credential provider. |
| [`redis_basics.py`](redis_basics.py) | Shows standalone provider usage and agent integration. Demonstrates writing messages to Redis, retrieving context via full‑text or hybrid vector search, and persisting preferences across threads. Also includes a simple tool example whose outputs are remembered. |
| [`redis_conversation.py`](redis_conversation.py) | Simple example showing conversation persistence with RedisContextProvider using traditional connection string authentication. |
| [`redis_conversation.py`](redis_conversation.py) | Shows cross-session context retrieval with RedisContextProvider using a Redis connection URL and OpenAI embeddings. For complete conversation history persistence, use RedisHistoryProvider. |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in be77390: the conversation example now describes context retrieval across turns. All six runs reuse the same session in the sample.

2. Python environment with Agent Framework Redis extra installed
3. Microsoft Foundry project endpoint and Azure OpenAI Responses deployment
4. Optional: OpenAI API key if using vector embeddings
4. OpenAI API key for the OpenAI-vectorizer examples (`redis_basics.py`, `redis_conversation.py`, and the hybrid-search scenario in `redis_sessions.py`)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in be77390: the OpenAI key prerequisite now includes both hybrid-search and multiple-agents in redis_sessions.py. Both scenarios construct an OpenAITextVectorizer.

@ktz03
LI (ktz03) deployed to github-app-auth October 16, 2026 08:45 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
github-app-auth — be773904 Deployed Oct 16, 2026 by ktz03 via add_label #25577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants