{"id":36442361,"url":"https://github.com/aws-samples/sample-strands-agents-chat","last_synced_at":"2026-01-18T15:00:29.740Z","repository":{"id":309655579,"uuid":"1037068834","full_name":"aws-samples/sample-strands-agents-chat","owner":"aws-samples","description":"A full-stack AI chat application powered by Amazon Bedrock and Strands Agents","archived":false,"fork":false,"pushed_at":"2025-10-02T04:50:55.000Z","size":1646,"stargazers_count":15,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T06:25:11.670Z","etag":null,"topics":["a2a","agentcore","ai-agents","bedrock","mcp","multiagent","serverless","strands-agents"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-13T02:50:00.000Z","updated_at":"2025-10-02T04:50:57.000Z","dependencies_parsed_at":"2025-09-18T10:25:54.404Z","dependency_job_id":null,"html_url":"https://github.com/aws-samples/sample-strands-agents-chat","commit_stats":null,"previous_names":["aws-samples/sample-strands-agents-chat"],"tags_count":0,"template":false,"template_full_name":"amazon-archives/__template_MIT-0","purl":"pkg:github/aws-samples/sample-strands-agents-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-samples%2Fsample-strands-agents-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-samples%2Fsample-strands-agents-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-samples%2Fsample-strands-agents-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-samples%2Fsample-strands-agents-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws-samples","download_url":"https://codeload.github.com/aws-samples/sample-strands-agents-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws-samples%2Fsample-strands-agents-chat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28538865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","agentcore","ai-agents","bedrock","mcp","multiagent","serverless","strands-agents"],"created_at":"2026-01-11T22:00:18.247Z","updated_at":"2026-01-18T15:00:29.723Z","avatar_url":"https://github.com/aws-samples.png","language":"TypeScript","funding_links":[],"categories":["Community Projects"],"sub_categories":["For PyPI Packages"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🤖 Strands Agents Chat\n\n*A full-stack AI chat application powered by Amazon Bedrock, Strands Agents, and Bedrock AgentCore*\n\n[![AWS](https://img.shields.io/badge/AWS-FF9900?style=for-the-badge\u0026logo=amazon-aws\u0026logoColor=white)](https://aws.amazon.com/)\n[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)](https://python.org/)\n[![React](https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB)](https://reactjs.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://typescriptlang.org/)\n\n\u003c/div\u003e\n\n---\n\n## 📸 Screenshots\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"img/screenshot01.png\" alt=\"Chat Interface\" width=\"45%\" style=\"margin-right: 2%; margin-bottom: 10px;\" /\u003e\n  \u003cimg src=\"img/screenshot02.png\" alt=\"Mobile View\" width=\"45%\" style=\"margin-left: 2%; margin-bottom: 10px;\" /\u003e\n  \u003cbr /\u003e\n  \u003cimg src=\"img/screenshot03.png\" alt=\"Feature View\" width=\"45%\" style=\"margin-right: 2%;\" /\u003e\n  \u003cimg src=\"img/screenshot04.png\" alt=\"Settings View\" width=\"45%\" style=\"margin-left: 2%;\" /\u003e\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\nThis is a sample application that serves as a base implementation for chat applications utilizing **Strands Agents**.\n\n🏗️ **Simple Architecture** - Clean, maintainable codebase with serverless scalability\n\n🎨 **Rich UI/UX** - Polished chat interface with intuitive user experience\n\n🔧 **Extensible with Strands Agents** - Ready for customization with MCP, A2A, Multi Agents, Bedrock AgentCore, and more\n\n🖼️ **Gallery Mode** - Visual gallery for viewing and managing uploaded images and files\n\n📱 **Responsive Design** - Optimized for both desktop and mobile usage\n\n\u003e **💡 Perfect Starting Point**: If you want to build a governance-enabled, self-hosted, high-functionality generative AI chat application on AWS, using this application as your base implementation is an excellent starting point.\n\n---\n\n## 🏛️ Architecture\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"img/arch.drawio.png\" alt=\"System Architecture\" width=\"50%\" /\u003e\n\u003c/div\u003e\n\n---\n\n## 🛠️ Built-in Tools\n\n| Tool | Description | Technology |\n|------|-------------|------------|\n| 💬 **Multi-modal Chat** | Support for images, videos, and documents | Amazon Bedrock |\n| 🧠 **Deep Reasoning** | Advanced AI reasoning for complex problem solving | Amazon Bedrock |\n| 🎨 **Image Generation** | AI-powered image creation | Nova Canvas MCP |\n| 📚 **AWS Documentation Search** | Search and access AWS documentation | AWS Documentation MCP |\n| 🔍 **Web Search** | Real-time web search capabilities | Tavily API |\n| 💻 **CodeInterpreter** | Execute and analyze code in real-time | Bedrock AgentCore |\n| 🌐 **Web Browser** | Browse web pages and analyze content | Bedrock AgentCore |\n\n---\n\n## 🚀 Deployment Guide\n\n### Step 1: (Optional) Create Tavily API Key Secret\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand Tavily API setup instructions\u003c/summary\u003e\n\n1. Open [AWS Secrets Manager](https://console.aws.amazon.com/secretsmanager)\n2. Click **\"Store a new secret\"**\n3. Select **\"Other type of secret\"**\n4. Choose **\"Plaintext\"** and paste your Tavily API Key\n5. Create the secret and copy the **Secret ARN**\n\n\u003c/details\u003e\n\n### Step 2: (Required) Configure Parameters\n\n```bash\n# Navigate to CDK directory\ncd cdk\n\n# Install dependencies\nnpm ci\n\n# Copy the parameter template\ncp parameter.template.ts parameter.ts\n\n# Edit parameter.ts with your configuration\n# Note: If tavilyApiKeySecretArn is null, web search tool will be disabled\n```\n\n### Step 3: (Required) Deploy with CDK\n\n```bash\n# Bootstrap CDK (run once per AWS account/region)\nnpx cdk bootstrap\n\n# Deploy all stacks\nnpx cdk deploy --all --require-approval never\n```\n\n🎉 **Access your application** using the `WebUrl` from the deployment output!\n\n---\n\n## 💻 Development\n\n### Frontend Development\n\nFor frontend development, you can run the development server locally while connecting to your deployed backend:\n\n```bash\n# Navigate to web directory\ncd web\n\n# Install dependencies\nnpm ci\n\n# Start development server\nnpm run dev\n```\n\nThe development server will:\n- 🚀 Start at `http://localhost:5173`\n- 🔗 Automatically import necessary values from the `StrandsChat` stack output\n- 🔄 Enable hot reload for rapid development\n\n### Pre-commit Checks\n\nBefore committing your changes, ensure code quality by running the pre-check script:\n\n```bash\n# Run pre-commit checks\n./pre_check.sh\n```\n\nThis script will validate your code formatting, run tests, and ensure everything is ready for commit.\n\n---\n\n## ⚙️ Customization\n\n### 🛡️ WAF Configuration (Access Restrictions)\n\nThe WAF settings are defined in `cdk/lib/waf-stack.ts`. Customize this file to modify security rules.\n\n\u003e **Default behavior**: Allows access from all IP addresses and countries\n\n**IP Restriction Example:**\n```typescript\n// Modify IP addresses in waf-stack.ts (line 15)\nconst allIpv4 = new wafv2.CfnIPSet(this, 'AllowedIpv4Set', {\n  name: 'StrandsChatIpv4',\n  scope: 'CLOUDFRONT',\n  ipAddressVersion: 'IPV4',\n  addresses: ['192.168.1.0/24', '10.0.0.0/8'], // Replace with your allowed IP ranges\n});\n```\n\n**GEO Restriction Example:**\n```typescript\n// Add country-based rule to the rules array in waf-stack.ts (line 34)\n{\n  name: 'GeoRestriction',\n  priority: 1,\n  action: { allow: {} },\n  statement: {\n    geoMatchStatement: {\n      countryCodes: ['US', 'JP', 'CA'], // Allow only these countries\n    },\n  },\n  visibilityConfig: {\n    cloudWatchMetricsEnabled: true,\n    metricName: 'GeoRestriction',\n    sampledRequestsEnabled: true,\n  },\n},\n```\n\n\u003e **Country Codes**: Use ISO 3166-1 alpha-2 country codes (e.g., 'US' for United States, 'JP' for Japan)\n\n### 🔐 Disable Cognito Signup\n\nIf you want to disable the Cognito signup functionality and restrict user registration:\n\n**Backend Configuration:**\n1. Open `cdk/lib/strands-chat-stack.ts`\n2. Find the UserPool configuration\n3. Change `selfSignUpEnabled` from `true` to `false`\n\n```typescript\n// In strands-chat-stack.ts (line 66-78)\nconst userPool = new UserPool(this, 'UserPool', {\n  selfSignUpEnabled: false, // Change from true to false\n  signInAliases: {\n    username: false,\n    email: true,\n  },\n  passwordPolicy: {\n    requireUppercase: true,\n    requireSymbols: true,\n    requireDigits: true,\n    minLength: 8,\n  },\n});\n```\n\n**Frontend Configuration:**\n1. Open `web/src/components/AuthWithUserPool.tsx`\n2. Add the `hideSignup={true}` option to the `\u003cAuthenticator\u003e` component\n\n```tsx\n// In AuthWithUserPool.tsx (line 75)\n\u003cAuthenticator\n  hideSignup={true}\n  components={{\n    Header() {\n      return (\n        \u003cdiv className=\"my-8 text-center\"\u003e\n          \u003ch1 className=\"text-3xl font-bold text-blue-600 transition-colors duration-300 dark:text-blue-400\"\u003e\n            Strands Chat\n          \u003c/h1\u003e\n        \u003c/div\u003e\n      );\n    },\n  }}\u003e\n```\n\n\u003e **Note**: After making these changes, redeploy the CDK stack for backend changes to take effect.\n\n---\n\n## 🏗️ Technology Stack\n\n\u003cdiv align=\"center\"\u003e\n\n| Layer | Technology | Purpose |\n|-------|------------|---------|\n| **Frontend** | React 19 + TypeScript + Tailwind CSS | Modern, responsive UI |\n| **Backend** | Python 3.13 + FastAPI + Strands Agents | AI-powered API |\n| **Infrastructure** | AWS CDK + Lambda + DynamoDB + S3 | Serverless architecture |\n| **AI/ML** | Amazon Bedrock + Claude | Advanced language models |\n| **Authentication** | AWS Cognito | Secure user management |\n\n\u003c/div\u003e\n\n---\n\n## 📁 Project Structure\n\n```\n├── 🐍 api/           # Python FastAPI backend\n├── ☁️ cdk/           # AWS CDK infrastructure\n├── ⚛️ web/           # React frontend application\n└── 📖 README.md      # Project documentation\n```\n\n## Security\n\nSee [CONTRIBUTING](/CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis library is licensed under the MIT-0 License. See the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-samples%2Fsample-strands-agents-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws-samples%2Fsample-strands-agents-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws-samples%2Fsample-strands-agents-chat/lists"}