Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ repos:
- id: check-toml
stages: [pre-commit]
- id: check-json
exclude: ^src/bedrock_agentcore_starter_toolkit/ui/frontend/
stages: [pre-commit]
- id: check-yaml
exclude: ^documentation/mkdocs\.yaml$
stages: [pre-commit]
- id: check-merge-conflict
stages: [pre-commit]
- id: check-added-large-files
args: ['--maxkb=1000']
args: ["--maxkb=1000"]
stages: [pre-commit]
- id: debug-statements
stages: [pre-commit]
Expand All @@ -52,10 +53,10 @@ repos:

# Security scanning
- repo: https://github.com/PyCQA/bandit
rev: '1.7.9'
rev: "1.7.9"
hooks:
- id: bandit
args: ['-r', 'src/', '-ll']
args: ["-r", "src/", "-ll"]
pass_filenames: false
types: [python]
stages: [pre-push]
Expand All @@ -70,15 +71,16 @@ repos:
types: [python]
pass_filenames: false
always_run: true
stages: [pre-push] # Moved from pre-commit to pre-push
args: [
--cov=src,
--cov-report=term-missing,
--cov-report=html,
--cov-branch,
--cov-precision=2,
tests/
]
stages: [pre-push] # Moved from pre-commit to pre-push
args:
[
--cov=src,
--cov-report=term-missing,
--cov-report=html,
--cov-branch,
--cov-precision=2,
tests/,
]

# ========================================
# Configuration
Expand All @@ -93,8 +95,8 @@ ci:

for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false
Expand Down
126 changes: 124 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</div>

## Overview

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.

Amazon Bedrock AgentCore includes the following modular Services that you can use together or independently:
Expand All @@ -45,42 +46,47 @@ AgentCore Runtime is a secure, serverless runtime purpose-built for deploying an
**[Runtime Quick Start](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-toolkit.html)**

## 🧠 Amazon Bedrock AgentCore Memory
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.

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.

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

## 🔗 Amazon Bedrock AgentCore Gateway

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.

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

## 💻 Amazon Bedrock AgentCore Code Interpreter

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.

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

## 🌐 Amazon Bedrock AgentCore Browser

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.

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

## 📊 Amazon Bedrock AgentCore Observability

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.

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

## 🔐 Amazon Bedrock AgentCore Identity

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.

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

## 🔐 Import Amazon Bedrock Agents to Bedrock AgentCore

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.

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


## Installation

### Quick Start
Expand All @@ -96,6 +102,122 @@ uv pip install bedrock-agentcore-starter-toolkit
pip install bedrock-agentcore-starter-toolkit
```

## 🖥️ Web UI for AgentCore

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.

### Agent Requirements for UI Compatibility

For your AgentCore agent to work with the UI, it must accept input in the following format:

**Required Input Format:**

```json
{
"prompt": "Your message here"
}
```

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.

**Example Agent Implementation:**

```python
from bedrock_agentcore import BedrockAgentCoreApp
from strands import Agent

app = BedrockAgentCoreApp()
agent = Agent()

@app.entrypoint
def invoke(payload):
"""Agent entrypoint that accepts UI input format"""
# Extract the prompt from the payload
user_message = payload.get("prompt", "")

# Process the message with your agent
result = agent(user_message)

# Return the response
return {"result": result.message}
```

**Key Points:**

- The UI sends messages as `{"prompt": "user message"}`
- Your agent should read from `payload.get("prompt")` or `payload["prompt"]`
- Your agent can return any JSON-serializable response
- The UI will display the response content in the chat interface
- This format is compatible with the standard AgentCore Runtime invocation pattern

**Testing Compatibility:**

You can test your agent's compatibility with the UI format locally:

```bash
# Start your agent locally
python my_agent.py

# Test with the UI format
curl -X POST http://localhost:8080/invocations \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello!"}'
```

If your agent responds successfully, it will work with the UI.

### Launching the UI

Launch your agent with the `--ui` flag to automatically start the web interface:

```bash
# Launch with local agent (running in container)
agentcore launch --local --ui

# Launch with remote agent (deployed to AWS)
agentcore launch --ui

# Launch UI only connecting to remote agent (deployed to AWS)
agentcore ui
```

The UI will automatically open in your default browser at `http://localhost:8001`.

### Local vs Remote Mode

**Local Mode** (`--local` flag):

- Connects to an agent running locally in a Docker container at `http://127.0.0.1:8000`
- No AWS credentials required
- Perfect for development and testing
- No authentication needed

**Remote Mode** (default):

- Connects to an agent deployed to AWS via AgentCore Runtime
- Uses your AWS credentials from the environment (AWS CLI, environment variables, etc.)
- Supports IAM and OAuth authentication
- Reads agent configuration from `.bedrock_agentcore.yaml`

### Features

- **Interactive Chat**: Send messages to your agent and view responses in a clean chat interface
- **Session Management**: Create new conversation sessions to maintain context
- **Memory Inspector**: View memory resources, strategies, and configurations
- **Configuration Display**: See current agent settings, connection mode, and authentication method
- **Markdown Support**: Agent responses support formatted text, code blocks, and markdown

### UI Screenshots

The AgentCore UI provides:

- A responsive chat interface with user and agent message bubbles
- Real-time loading indicators during agent invocation
- A dedicated memory view showing all configured strategies
- Session ID display and new conversation controls
- Error handling with user-friendly messages

For more details on using the UI, see the [UI User Guide](src/bedrock_agentcore_starter_toolkit/ui/README.md).

## 📝 License & Contributing

Expand Down
Loading
Loading