Skip to content

Developer Guide

Welcome to the comprehensive developer guide for building AI agents in healthcare and life sciences. This guide will help you choose the right template and deploy your own specialized agents using Amazon Bedrock AgentCore.

Prerequisites

Before getting started, ensure you have:

  • AWS Account with access to Amazon Bedrock
  • Model Access - Request access to foundation models (e.g., Claude 3.5 Sonnet, Haiku)
  • AWS CLI configured with appropriate permissions
  • Python 3.10+ installed
  • Node.js 18+ and npm (for FAST template)
  • Git and GitHub account
  • Basic knowledge of AWS services and JSON/YAML configuration

Choosing Your Template

We provide two approaches for building agents, each suited for different use cases:

AgentCore Template

Best for: Backend-focused development, rapid prototyping, local testing

Includes:

  • Backend deployment scripts
  • Local Streamlit UI
  • Gateway, Memory, Cognito setup
  • IAM or OAuth authentication options
  • Sample tools and observability

Deploy time: ~15-20 minutes

FAST Template

Best for: Production deployments, full-stack applications, end-to-end solutions

Includes:

  • Complete CDK infrastructure
  • Production React frontend
  • Amplify Hosting deployment
  • Code Interpreter integration
  • Local development support

Deploy time: ~20-30 minutes


Option 1: AgentCore Template

What is the AgentCore Template?

The AgentCore Template provides a streamlined approach to deploying AI agents with:

  • Backend Infrastructure: Gateway, Memory, Cognito, and Runtime
  • Local Development: Streamlit UI for rapid testing
  • Flexible Authentication: Choose between IAM or OAuth
  • Custom Tools: Easily add Lambda functions or local Python tools

Architecture:

┌─────────────────────────────────────────────┐
│ Local Streamlit UI │
│ (port 8501) │
└──────────────────┬──────────────────────────┘
┌──────────────────▼──────────────────────────┐
│ AgentCore Runtime (AWS) │
│ ┌──────────┐ ┌────────┐ ┌────────────┐ │
│ │ Gateway │ │ Memory │ │ Cognito │ │
│ └──────────┘ └────────┘ └────────────┘ │
└─────────────────────────────────────────────┘

When to use:

  • Rapid prototyping and experimentation
  • Backend-focused development
  • Internal tools and demos
  • Research and development workflows

Reference: agentcore_template/


Option 2: FAST Template (Fullstack Solution)

What is FAST?

The Fullstack AgentCore Solution Template (FAST) is a production-ready framework for deploying complete AI agent applications with:

  • End-to-End Infrastructure: CDK deployment of backend and frontend
  • Production React UI: Modern, responsive web interface with authentication
  • Amplify Hosting: Automatic frontend deployment with CloudFront CDN
  • Code Interpreter: Built-in Python code execution capabilities
  • Local Development: Docker Compose for local testing

Architecture:

┌───────────────────────────────────────────────────────┐
│ CloudFront + Amplify │
│ (React Frontend) │
└────────────────────┬──────────────────────────────────┘
┌────────────────────▼──────────────────────────────────┐
│ API Gateway + Cognito Auth │
└────────────────────┬──────────────────────────────────┘
┌────────────────────▼──────────────────────────────────┐
│ AgentCore Runtime (Container) │
│ ┌─────────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │ Gateway │ │ Memory │ │ Code Interpreter│ │
│ │ (Lambda) │ │ (DynamoDB│ │ (Sandboxed) │ │
│ └─────────────┘ └──────────┘ └─────────────────┘ │
└───────────────────────────────────────────────────────┘

When to use:

  • Production deployments
  • Customer-facing applications
  • Full-stack solutions with frontend
  • Scalable, secure applications

Reference:


Agent Development Best Practices

System Prompt Design

Craft effective system prompts for HCLS agents:

SYSTEM_PROMPT = """
You are a [DOMAIN] expert agent specializing in [SPECIFIC AREA].
## Core Capabilities
- [Capability 1]: [Description]
- [Capability 2]: [Description]
- [Capability 3]: [Description]
## Domain Expertise
You have deep knowledge of:
- [Knowledge area 1]
- [Knowledge area 2]
- [Knowledge area 3]
## Response Guidelines
ALWAYS:
- Cite authoritative sources
- Clarify ambiguities before responding
- Use domain-specific terminology correctly
- Provide confidence levels when uncertain
NEVER:
- Provide medical advice or diagnosis
- Make claims about insurance or billing
- Share patient-identifiable information
- Guarantee outcomes or results
## Tool Usage
- Use [tool_name] when [condition]
- Prefer [authoritative_source] over [secondary_source]
- Always indicate data source in responses
"""

Tool Development

Best Practices:

  • Single Responsibility: One tool, one clear purpose
  • Descriptive Docstrings: Help the LLM understand when to use
  • Type Hints: Enable better validation and documentation
  • Error Handling: Return meaningful error messages
  • Logging: Track usage and debug issues

Example:

from strands.tools import tool
from typing import Optional
@tool
def search_medical_database(
query: str,
database: str = "pubmed",
max_results: int = 10
) -> dict:
"""
Search medical literature databases for research articles.
Use this tool when the user asks about:
- Recent research findings
- Clinical trial data
- Medical literature references
Args:
query: Search query using medical terminology
database: Which database to search (pubmed, clinicaltrials, etc.)
max_results: Maximum number of results to return
Returns:
Dictionary with search results and metadata
"""
try:
# Implementation
results = perform_search(query, database, max_results)
return {
"success": True,
"results": results,
"source": database,
"query": query
}
except Exception as e:
return {
"success": False,
"error": str(e),
"query": query
}

Security Considerations

Authentication:

  • ✅ Use Cognito for user authentication
  • ✅ Implement M2M auth for service-to-service
  • ✅ Never hardcode credentials
  • ✅ Rotate secrets regularly

Data Protection:

  • ✅ Use environment variables for sensitive data
  • ✅ Enable encryption at rest (DynamoDB, S3)
  • ✅ Use VPC endpoints for private connectivity
  • ✅ Implement least-privilege IAM roles

HIPAA Compliance (if applicable):

  • ✅ Sign Business Associate Agreement (BAA) with AWS
  • ✅ Use HIPAA-eligible services only
  • ✅ Enable CloudTrail logging
  • ✅ Implement audit trails for PHI access

Testing Strategy

Unit Tests:

test_tools.py
def test_search_medical_database():
result = search_medical_database("diabetes treatment")
assert result["success"] == True
assert len(result["results"]) > 0

Integration Tests:

test_agent.py
def test_agent_response():
agent = create_agent()
response = agent.invoke("What is the ICD-10 code for diabetes?")
assert "E11" in response

End-to-End Tests:

Terminal window
# Use test scripts
python test-scripts/test-agent.py --test-suite

Contributing Your Agent

Once you’ve built and tested your agent, contribute it to the catalog:

Contribution Checklist

  • README.md: Clear description, use cases, setup instructions
  • Sample Queries: 5-10 example interactions
  • Architecture Diagram: Visual representation
  • Documentation: Deployment guide, troubleshooting
  • Tests: Automated test suite
  • License: Apache-2.0 or compatible
  • Public Data: Only use appropriately licensed data sources

Submission Process

  1. Fork the repository:

    Terminal window
    git clone https://github.com/YOUR-USERNAME/amazon-bedrock-agents-healthcare-lifesciences.git
    cd amazon-bedrock-agents-healthcare-lifesciences
  2. Create your agent directory:

    Terminal window
    mkdir -p agents_catalog/XX-YourAgentName
    cd agents_catalog/XX-YourAgentName
  3. Add required files:

    XX-YourAgentName/
    ├── README.md
    ├── architecture.png
    ├── requirements-dev.txt
    ├── patterns/
    │ └── strands-single-agent/
    │ └── your_agent.py
    ├── test-scripts/
    │ └── test-agent.py
    └── docs/
    └── DEPLOYMENT.md
  4. Create pull request:

    Terminal window
    git checkout -b add-your-agent-name
    git add .
    git commit -m "Add: YourAgentName for [use case]"
    git push origin add-your-agent-name
  5. Fill out PR template with:

    • Agent description and use cases
    • Key capabilities
    • Sample queries
    • Testing performed
    • Screenshots/demo video (optional)

Next Steps

Learn More

Get Help

Example Agents

Explore production-ready examples:


Ready to build? Choose your template and start deploying your AI agent today! 🚀