Repository navigation
Python: Align Redis context sample guide with current APIs - #9446
LI (ktz03) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 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. | |
There was a problem hiding this comment.
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`) |
There was a problem hiding this comment.
Updated in be77390: the OpenAI key prerequisite now includes both hybrid-search and multiple-agents in redis_sessions.py. Both scenarios construct an OpenAITextVectorizer.

Motivation & Context
The Redis context-provider sample guide still documents removed configuration names and the old
invokinghook. Its optional OpenAI-key instructions also conflict with examples that instantiateOpenAITextVectorizer.Description & Review Guide
redis_vectorizer,overwrite_index, thebefore_run/after_runhooks, and the existing examples' embedding prerequisites. Distinguish context retrieval from complete conversation-history persistence.Related Issue
N/A - trivial change: correct stale API names and setup instructions in one README; no runtime or public API changes.
AI Assistance
AI assistance details: Documentation, API checks, and PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" in the title prefix).