Skip to content

Commit 5ce6b53

Browse files
committed
feat: adding a chat UI feature to the toolkit
1 parent 86c2390 commit 5ce6b53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+16657
-42
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ specs/
2626
.claude/
2727
.specify/
2828
coverage.json
29-
CLAUDE.md
29+
CLAUDE.md

README.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,59 @@
2828
</div>
2929

3030
## Overview
31+
3132
Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With Amazon Bedrock AgentCore, developers can accelerate AI agents into production with the scale, reliability, and security, critical to real-world deployment. AgentCore provides tools and capabilities to make agents more effective and capable, purpose-built infrastructure to securely scale agents, and controls to operate trustworthy agents. Amazon Bedrock AgentCore services are composable and work with popular open-source frameworks and any model, so you don’t have to choose between open-source flexibility and enterprise-grade security and reliability.
3233

3334
Amazon Bedrock AgentCore includes the following modular Services that you can use together or independently:
3435

3536
## 🚀 Amazon Bedrock AgentCore Runtime
37+
3638
AgentCore Runtime is a secure, serverless runtime purpose-built for deploying and scaling dynamic AI agents and tools using any open-source framework including LangGraph, CrewAI, and Strands Agents, any protocol, and any model. Runtime was built to work for agentic workloads with industry-leading extended runtime support, fast cold starts, true session isolation, built-in identity, and support for multi-modal payloads. Developers can focus on innovation while Amazon Bedrock AgentCore Runtime handles infrastructure and security -- accelerating time-to-market
3739

3840
**[Runtime Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-toolkit.html)**
3941

4042
## 🧠 Amazon Bedrock AgentCore Memory
41-
AgentCore Memory makes it easy for developers to build context aware agents by eliminating complex memory infrastructure management while providing full control over what the AI agent remembers. Memory provides industry-leading accuracy along with support for both short-term memory for multi-turn conversations and long-term memory that can be shared across agents and sessions.
4243

44+
AgentCore Memory makes it easy for developers to build context aware agents by eliminating complex memory infrastructure management while providing full control over what the AI agent remembers. Memory provides industry-leading accuracy along with support for both short-term memory for multi-turn conversations and long-term memory that can be shared across agents and sessions.
4345

4446
**[Memory Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory-get-started.html)**
4547

4648
## 🔗 Amazon Bedrock AgentCore Gateway
49+
4750
Amazon Bedrock AgentCore Gateway acts as a managed Model Context Protocol (MCP) server that converts APIs and Lambda functions into MCP tools that agents can use. Gateway manages the complexity of OAuth ingress authorization and secure egress credential exchange, making standing up remote MCP servers easier and more secure. Gateway also offers composition and built-in semantic search over tools, enabling developers to scale their agents to use hundreds or thousands of tools.
4851

4952
**[Gateway Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-quick-start.html)**
5053

5154
## 💻 Amazon Bedrock AgentCore Code Interpreter
55+
5256
AgentCore Code Interpreter tool enables agents to securely execute code in isolated sandbox environments. It offers advanced configuration support and seamless integration with popular frameworks. Developers can build powerful agents for complex workflows and data analysis while meeting enterprise security requirements.
5357

5458
**[Code Interpreter Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-getting-started.html)**
5559

5660
## 🌐 Amazon Bedrock AgentCore Browser
61+
5762
AgentCore Browser tool provides a fast, secure, cloud-based browser runtime to enable AI agents to interact with websites at scale. It provides enterprise-grade security, comprehensive observability features, and automatically scales— all without infrastructure management overhead.
5863

5964
**[Browser Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-onboarding.html)**
6065

6166
## 📊 Amazon Bedrock AgentCore Observability
67+
6268
AgentCore Observability helps developers trace, debug, and monitor agent performance in production through unified operational dashboards. With support for OpenTelemetry compatible telemetry and detailed visualizations of each step of the agent workflow, AgentCore enables developers to easily gain visibility into agent behavior and maintain quality standards at scale.
6369

6470
**[Observability Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-get-started.html)**
6571

6672
## 🔐 Amazon Bedrock AgentCore Identity
73+
6774
AgentCore Identity provides a secure, scalable agent identity and access management capability accelerating AI agent development. It is compatible with existing identity providers, eliminating needs for user migration or rebuilding authentication flows. AgentCore Identity's helps to minimize consent fatigue with a secure token vault and allows you to build streamlined AI agent experiences. Just-enough access and secure permission delegation allow agents to securely access AWS resources and third-party tools and services.
6875

6976
**[Identity Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-getting-started-cognito.html)**
7077

7178
## 🔐 Import Amazon Bedrock Agents to Bedrock AgentCore
79+
7280
AgentCore Import-Agent enables seamless migration of existing Amazon Bedrock Agents to LangChain/LangGraph or Strands frameworks while automatically integrating AgentCore primitives like Memory, Code Interpreter, and Gateway. Developers can migrate agents in minutes with full feature parity and deploy directly to AgentCore Runtime for serverless operation.
7381

7482
**[Import Agent Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/import-agent/quickstart.html)**
7583

76-
7784
## Installation
7885

7986
### Quick Start
@@ -89,6 +96,122 @@ uv pip install bedrock-agentcore-starter-toolkit
8996
pip install bedrock-agentcore-starter-toolkit
9097
```
9198

99+
## 🖥️ Web UI for AgentCore
100+
101+
The Bedrock AgentCore Starter Toolkit includes a modern web interface for interacting with your agents and inspecting memory resources. The UI provides an intuitive chat interface and memory viewer, making it easy to test and demonstrate agent capabilities.
102+
103+
### Agent Requirements for UI Compatibility
104+
105+
For your AgentCore agent to work with the UI, it must accept input in the following format:
106+
107+
**Required Input Format:**
108+
109+
```json
110+
{
111+
"prompt": "Your message here"
112+
}
113+
```
114+
115+
The UI sends user messages as a JSON payload with a `prompt` field containing the user's text. Your agent's entrypoint function should extract this field to process the message.
116+
117+
**Example Agent Implementation:**
118+
119+
```python
120+
from bedrock_agentcore import BedrockAgentCoreApp
121+
from strands import Agent
122+
123+
app = BedrockAgentCoreApp()
124+
agent = Agent()
125+
126+
@app.entrypoint
127+
def invoke(payload):
128+
"""Agent entrypoint that accepts UI input format"""
129+
# Extract the prompt from the payload
130+
user_message = payload.get("prompt", "")
131+
132+
# Process the message with your agent
133+
result = agent(user_message)
134+
135+
# Return the response
136+
return {"result": result.message}
137+
```
138+
139+
**Key Points:**
140+
141+
- The UI sends messages as `{"prompt": "user message"}`
142+
- Your agent should read from `payload.get("prompt")` or `payload["prompt"]`
143+
- Your agent can return any JSON-serializable response
144+
- The UI will display the response content in the chat interface
145+
- This format is compatible with the standard AgentCore Runtime invocation pattern
146+
147+
**Testing Compatibility:**
148+
149+
You can test your agent's compatibility with the UI format locally:
150+
151+
```bash
152+
# Start your agent locally
153+
python my_agent.py
154+
155+
# Test with the UI format
156+
curl -X POST http://localhost:8080/invocations \
157+
-H "Content-Type: application/json" \
158+
-d '{"prompt": "Hello!"}'
159+
```
160+
161+
If your agent responds successfully, it will work with the UI.
162+
163+
### Launching the UI
164+
165+
Launch your agent with the `--ui` flag to automatically start the web interface:
166+
167+
```bash
168+
# Launch with local agent (running in container)
169+
agentcore launch --local --ui
170+
171+
# Launch with remote agent (deployed to AWS)
172+
agentcore launch --ui
173+
174+
# Launch UI only connecting to remote agent (deployed to AWS)
175+
agentcore ui
176+
```
177+
178+
The UI will automatically open in your default browser at `http://localhost:8001`.
179+
180+
### Local vs Remote Mode
181+
182+
**Local Mode** (`--local` flag):
183+
184+
- Connects to an agent running locally in a Docker container at `http://127.0.0.1:8000`
185+
- No AWS credentials required
186+
- Perfect for development and testing
187+
- No authentication needed
188+
189+
**Remote Mode** (default):
190+
191+
- Connects to an agent deployed to AWS via AgentCore Runtime
192+
- Uses your AWS credentials from the environment (AWS CLI, environment variables, etc.)
193+
- Supports IAM and OAuth authentication
194+
- Reads agent configuration from `.bedrock_agentcore.yaml`
195+
196+
### Features
197+
198+
- **Interactive Chat**: Send messages to your agent and view responses in a clean chat interface
199+
- **Session Management**: Create new conversation sessions to maintain context
200+
- **Memory Inspector**: View memory resources, strategies, and configurations
201+
- **Configuration Display**: See current agent settings, connection mode, and authentication method
202+
- **Markdown Support**: Agent responses support formatted text, code blocks, and markdown
203+
204+
### UI Screenshots
205+
206+
The AgentCore UI provides:
207+
208+
- A responsive chat interface with user and agent message bubbles
209+
- Real-time loading indicators during agent invocation
210+
- A dedicated memory view showing all configured strategies
211+
- Session ID display and new conversation controls
212+
- Error handling with user-friendly messages
213+
214+
For more details on using the UI, see the [UI User Guide](src/bedrock_agentcore_starter_toolkit/ui/README.md).
92215

93216
## 📝 License & Contributing
94217

0 commit comments

Comments
 (0)