feat(market-trends-agent): add demo UI, LangGraph checkpointer/store,…#1423
Open
deepaxs wants to merge 1 commit intoawslabs:mainfrom
Open
feat(market-trends-agent): add demo UI, LangGraph checkpointer/store,…#1423deepaxs wants to merge 1 commit intoawslabs:mainfrom
deepaxs wants to merge 1 commit intoawslabs:mainfrom
Conversation
Author
|
Ready for review. I'm unable to add the review ready label |
… multi-region support - Add AgentCoreMemorySaver (checkpointer) and AgentCoreMemoryStore for dual-layer memory - Add React chat UI with pre-built broker profiles and markdown rendering - Add FastAPI backend proxy bridging UI to deployed AgentCore agent - Add run_demo_ui.py launcher for single-command startup - Replace hardcoded us-east-1 with os.getenv for multi-region deployability - Add IAM permissions for checkpointer and memory record operations - Fix extract_actor_id regex and add new intro patterns - Remove personal AWS_PROFILE reference from error message - Sync requirements.txt with pyproject.toml (fastapi, uvicorn, langgraph-checkpoint-aws) - Update README with UI setup, architecture diagram, and troubleshooting
aa6b03d to
bc61834
Compare
Author
|
I have rebased onto latest main and resolved conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amazon Bedrock AgentCore Samples Pull Request
Important
review readylabel to it. Only PRs withreview readywill be reviewed.Issue number:
Extend the Market Trend AI Agent use cases with a new UI and memory integration #1422
Concise description of the PR
Changes to 02-use-cases/market-trends-agent, adding a React demo UI,
LangGraph AgentCore Memory checkpointer/store integration, FastAPI backend
proxy, and multi-region support. These changes turn the existing sample into
a full-stack interactive demo with persistent broker profiles across sessions.
User experience
Before: The market-trends-agent could only be tested via CLI scripts (test_agent.py, test_broker_card.py). No visual interface, no conversation persistence across invocations, and hardcoded to us-east-1 only.
After: Users can launch a React chat UI (uv run python run_demo_ui.py) with pre-built broker profiles, markdown-rendered responses, and session management. The agent persists conversations within a session (checkpointer) and remembers broker preferences across sessions (store). Deployable to any region via --region flag.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Market Trends Agent: Interactive UI + LangGraph Checkpointer/Store Integration
Summary
Extends the market-trends-agent use case with LangGraph AgentCore Memory checkpointer and store integration, a React chat UI, and a FastAPI backend proxy — creating a full-stack demo of personalized financial intelligence with persistent broker profiles.
Changes by Area
Reviewers: each section below is independent. Review in order or jump to the area most relevant to you.
1. Agent Architecture — LangGraph Checkpointer + Store (
market_trends_agent.py)AgentCoreMemorySaver(checkpointer) to persist full conversation state across invocations viathread_idAgentCoreMemoryStorefor long-term cross-session preference extractiongraph_builder.compile(checkpointer=checkpointer, store=store)chatbotnode — removed manual conversation saving logic and message filtering (checkpointer handles this now)RunnableConfigwiththread_idandactor_idpassed at invocation timeactor_idparameter (e.g.,get_broker_financial_profile(actor_id))2. FastAPI Backend Proxy (
api_server.py) — NEW FILEPOST /api/chat— invokes deployed agent viabedrock-agentcoreboto3 client, passes session ID for memory continuityGET /api/health— reports agent deployment status (checks.agent_arnfile)3. React Chat Frontend (
frontend/) — NEW DIRECTORYreact-markdown+remark-gfmwith GFM table support)/apicalls to backend on port 80014. Launcher (
run_demo_ui.py) — NEW FILEuv run python run_demo_ui.py) starts both backend (uvicorn:8001) and frontend (Vite:3000)5. Deployment Updates (
deploy.py)GetCheckpoint,PutCheckpoint,ListCheckpointsRetrieveMemoryRecords,CreateMemoryRecord,DeleteMemoryRecord,UpdateMemoryRecord6. README.md Updates
npm install) andrun_demo_ui.pylauncher7. Dependencies (
pyproject.toml,requirements.txt)fastapi,uvicorn[standard]for API serverlanggraph-checkpoint-awsfor AgentCore checkpointer integrationreact^18.3.1,react-dom,react-markdown^9.0.1,remark-gfm^4.0.1,vite^6.0.08. Tool Fixes (
tools/memory_tools.py,tools/browser_tool.py)AWS_PROFILE=burnerfrom error message — replaced with genericpython deploy.py --region us-east-1extract_actor_idregex to stop at delimiters ("and", "from", "at") instead of capturing entire line"I am","Name is","Hi/Hello/Hey, I'm"list_conversation_historynow tries multiple actor IDs (session-based → override → default) instead of onebrowser_tool.py: cosmetic blank line onlyWhat Did NOT Change
broker_card_tools.py,tools/__init__.py— zero modificationsdeploy.pycleanup.pyunchangedHow to Test
Known Limitations
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.