awslabs / awslabs/agentcore-samples

01-tutorials - [Content Improvement] LangGraph tutorial uses deprecated create_react_agent API

Open
#804 6 comments 0 reactions 1 assignee Claimed by @akshseh View on GitHub
01-tutorials documentation
Dominant language
Python
Stars
3.4k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
30

Description

**Which component is impacted by this improvement?**
- [ ] 01-AgentCore-runtime
- [ ] 02-AgentCore-gateway
- [ ] 03-AgentCore-identity
- [x] 04-AgentCore-memory
- [ ] 05-AgentCore-tools
- [ ] 06-AgentCore-observability
- [ ] 07-AgentCore-E2E

**Improvement Description**
A clear and concise description of the improvement.

The existing tutorial `using-langgraph-agent-hooks` in `04-AgentCore-memory/02-long-term-memory/01-single-agent/` uses:

- `create_react_agent`
- `pre_model_hook` / `post_model_hook` parameters

These are **deprecated in LangGraph v1.0**.

**Impact:**
- Users following the tutorial encounter deprecation warnings
- Code may break in future LangGraph versions
- No example exists for the new middleware pattern

**Suggested Improvement:**
Add a new tutorial demonstrating LangGraph v1.0 approach using `create_agent` with `@before_model` / `@after_model` middleware decorators.

I have a working implementation ready to submit as a PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.