Skip to content

feat: agentcore initial implementation #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: v5
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ node_modules

# MkDocs documentation
site*/
.cache
.cache

# Coding Asssitant
.kiro/settings
.kiro/specs
24 changes: 24 additions & 0 deletions .kiro/steering/product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generative AI Use Cases (GenU)

GenU is a well-architected application implementation with business use cases for utilizing generative AI in business operations. It provides a platform for deploying and using various generative AI capabilities in a secure, enterprise-ready environment.

## Core Features

- **Multiple AI Use Cases**: Chat, Text Generation, Summarization, Meeting Minutes, Writing, Translation, Web Content Extraction, Image Generation, Video Generation, Video Analysis, Diagram Generation, Voice Chat
- **RAG (Retrieval Augmented Generation)**: Supports both Amazon Kendra and Knowledge Base for connecting AI to your organization's documents
- **Agent Support**: Integration with Bedrock Agents and Flows for specialized AI capabilities
- **Use Case Builder**: Create custom use cases with natural language prompt templates without coding
- **Security Features**: SAML authentication, IP restrictions, and other enterprise security controls
- **Multi-language Support**: Internationalization with multiple language interfaces

## Target Users

GenU is designed for organizations looking to implement generative AI capabilities in a secure, controlled environment with enterprise-grade features and customization options.

## Key Differentiators

- Well-architected AWS implementation following best practices
- Extensive customization options through configuration
- Support for multiple AI models and capabilities
- Enterprise security features
- No-code custom use case creation
105 changes: 105 additions & 0 deletions .kiro/steering/structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Project Structure

## Root Organization

The project follows a monorepo structure with workspaces:

```
generative-ai-use-cases/
├── docs/ # Documentation files (English and Japanese)
├── packages/ # Main code packages
│ ├── cdk/ # AWS CDK infrastructure code
│ ├── common/ # Shared utilities and types
│ ├── types/ # TypeScript type definitions
│ └── web/ # Frontend web application
├── browser-extension/ # Browser extension code
└── .husky/ # Git hooks
```

## Key Packages

### packages/cdk

Contains all AWS infrastructure code defined using CDK:

```
packages/cdk/
├── bin/ # CDK app entry point
├── lib/ # CDK constructs and stacks
│ ├── construct/ # Reusable CDK constructs
│ └── utils/ # Helper utilities
├── lambda/ # Lambda function code
├── lambda-python/ # Python Lambda functions
├── custom-resources/ # Custom CDK resources
│ ├── agent-core-runtime/
│ └── opensearch-index/
├── assets/ # Static assets for deployment
└── cdk.json # CDK configuration
```

### packages/web

Contains the React frontend application:

```
packages/web/
├── public/ # Static assets
├── src/
│ ├── components/ # Reusable UI components
│ ├── hooks/ # React hooks
│ ├── pages/ # Page components
│ ├── utils/ # Utility functions
│ ├── i18n/ # Internationalization
│ └── prompts/ # AI prompt templates
└── vite.config.ts # Vite configuration
```

### packages/types

Contains TypeScript type definitions shared across packages:

```
packages/types/src/
├── agent.d.ts # Agent-related types
├── chat.d.ts # Chat-related types
├── message.d.ts # Message-related types
├── agent-core.d.ts # Agent Core types
└── ... # Other type definitions
```

## Documentation

Documentation is available in both English and Japanese:

```
docs/
├── en/ # English documentation
├── ja/ # Japanese documentation
└── assets/ # Documentation assets and images
```

## Browser Extension

A browser extension is available for accessing GenU functionality:

```
browser-extension/
├── src/ # Extension source code
├── public/ # Static assets
└── tools/ # Build tools
```

## Code Conventions

1. **TypeScript**: The project uses TypeScript throughout for type safety
2. **React Components**: Functional components with hooks
3. **CDK Constructs**: Modular CDK constructs for infrastructure components
4. **Internationalization**: All user-facing text uses i18n for translation
5. **Testing**: Jest for unit tests

## Configuration Files

- `package.json`: Root package with workspace definitions and scripts
- `packages/cdk/cdk.json`: Main configuration for AWS deployment
- `packages/web/vite.config.ts`: Frontend build configuration
- `mkdocs.yml`: Documentation site configuration
123 changes: 123 additions & 0 deletions .kiro/steering/tech.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Technical Stack and Build System

## Core Technologies

- **Frontend**: React with TypeScript, Vite, TailwindCSS
- **Backend**: AWS CDK (Cloud Development Kit) for infrastructure as code
- **AI Services**: Amazon Bedrock, Amazon Kendra, Amazon Transcribe
- **Authentication**: Amazon Cognito with SAML support
- **Storage**: Amazon S3, DynamoDB
- **API**: AWS API Gateway, AWS Lambda

## Key Libraries and Frameworks

### Frontend

- React 18
- TypeScript
- Vite for build tooling
- TailwindCSS for styling
- i18next for internationalization
- SWR for data fetching
- Zustand for state management
- React Router for navigation
- AWS Amplify for AWS service integration

### Backend

- AWS CDK for infrastructure as code
- TypeScript
- AWS Lambda for serverless functions
- AWS SDK for JavaScript

## Project Build Commands

### Root Project Commands

```bash
# Install dependencies
npm ci

# Run linting
npm run lint

# Run tests
npm run test

# Deploy AWS resources
npm run cdk:deploy

# Fast deployment (without pre-checking)
npm run cdk:deploy:quick

# Delete AWS resources
npm run cdk:destroy

# Documentation development server
npm run docs:dev

# Build documentation
npm run docs:build
```

### Web Frontend Commands

```bash
# Start development server
npm run web:dev

# Build for production
npm run web:build

# Run linting
npm run web:lint

# Run tests
npm run web:test
```

### CDK Commands

```bash
# Bootstrap CDK (first-time setup)
npx -w packages/cdk cdk bootstrap

# Deploy CDK stacks
npm run cdk:deploy

# Run CDK tests
npm run cdk:test
```

### Browser Extension Commands

```bash
# Install extension dependencies
npm run extension:ci

# Start extension development
npm run extension:dev

# Build extension
npm run extension:build
```

## Environment Setup

Before deploying, ensure:

1. AWS CLI is configured with appropriate credentials
2. Node.js and npm are installed
3. Required Bedrock models are enabled in your AWS account
4. CDK is bootstrapped in your AWS environment (first-time only)

## Configuration

The main configuration file is `packages/cdk/cdk.json`, which controls:

- AWS region settings
- Enabled AI models and capabilities
- Security settings
- RAG configuration
- Agent and Flow settings
- UI customization options
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Additionally, it is possible to build a RAG that references data outside of AWS
</details>

<details markdown="1">
<summary><strong><ins>I want to use custom Bedrock Agents or Bedrock Flows within my organization</ins></strong></summary>
<summary><strong><ins>I want to use custom Bedrock Agents or AgentCore or Bedrock Flows within my organization</ins></strong></summary>

When you [enable agents](docs/en/DEPLOY_OPTION.md#enabling-agent-chat-use-case) in GenU, Web Search Agent and Code Interpreter Agent are created.
The Web Search Agent searches the web for information to answer user questions. For example, it can answer "What is AWS GenU?"
Expand All @@ -121,6 +121,8 @@ GenU provides a feature to [import agents](docs/en/DEPLOY_OPTION.md#adding-manua
By using GenU as a platform for agent utilization, you can leverage GenU's [rich security options](docs/en/DEPLOY_OPTION.md#security-related-settings) and [SAML authentication](docs/en/DEPLOY_OPTION.md#saml-authentication) to spread practical agents within your organization.
Additionally, you can [hide unnecessary standard use cases](docs/en/DEPLOY_OPTION.md#hiding-specific-use-cases) or [display agents inline](docs/en/DEPLOY_OPTION.md#displaying-agents-inline) to use GenU as a more agent-focused platform.

Similarly, there is an [import feature](docs/en/DEPLOY_OPTION.md#enabling-agentcore-use-cases) for AgentCore Runtime, so please make use of it.

Similarly, there is an [import feature](docs/en/DEPLOY_OPTION.md#enabling-flow-chat-use-case) for Bedrock Flows, so please make use of it.

Additionally, you can create agents that perform actions on services outside AWS by [enabling MCP chat](docs/en/DEPLOY_OPTION.md#enabling-mcp-chat-use-case) and adding external MCP servers to [packages/cdk/mcp-api/mcp.json](/packages/cdk/mcp-api/mcp.json).
Expand Down
4 changes: 3 additions & 1 deletion README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Knowledge Base を利用する場合は、[Advanced Parsing](docs/ja/DEPLOY_OPTI
</details>

<details markdown="1">
<summary><strong><ins>独自に作成した Bedrock Agents や Bedrock Flows などを社内で利用したい。</ins></strong></summary>
<summary><strong><ins>独自に作成した Bedrock Agents や AgentCore や Bedrock Flows などを社内で利用したい。</ins></strong></summary>

GenU で [エージェントを有効化](docs/ja/DEPLOY_OPTION.md#agent-チャットユースケースの有効化)すると Web 検索エージェントと Code Interpreter エージェントが作成されます。
Web 検索エージェントは、ユーザーの質問に回答するための情報を Web で検索し、回答します。例えば「AWS の GenU ってなに?」という質問に回答できます。
Expand All @@ -118,6 +118,8 @@ GenU では手動で作成したエージェントや別のアセットで作成
GenU をエージェント活用のプラットフォームとして利用することで、GenU が提供する [豊富なセキュリティオプション](docs/ja/DEPLOY_OPTION.md#セキュリティ関連設定) や [SAML認証](docs/ja/DEPLOY_OPTION.md#saml-認証) などを活用し、実践的なエージェントを社内に普及させることができます。
また、オプションで [不要な標準ユースケースを非表示](docs/ja/DEPLOY_OPTION.md#特定のユースケースを非表示にする) にしたり、[エージェントをインライン表示](docs/ja/DEPLOY_OPTION.md#agent-をインライン表示にする) することで、よりエージェントに特化したプラットフォームとして GenU をご利用いただくことが可能です。

AgentCore Runtime に関しても同様に [インポート機能](docs/ja/DEPLOY_OPTION.md#agentcore-ユースケースの有効化) がございますので、ぜひご活用ください。

Bedrock Flows に関しても同様に [インポート機能](docs/ja/DEPLOY_OPTION.md#flow-チャットユースケースの有効化) がございますので、ぜひご活用ください。

また、[MCP チャットを有効化](docs/ja/DEPLOY_OPTION.md#mcp-チャットユースケースの有効化) して外部サービスの MCP サーバーを [packages/cdk/mcp-api/mcp.json](/packages/cdk/mcp-api/mcp.json) に追加することで、AWS 外のサービスにも何らかのアクションを起こすエージェントを作成することも可能です。
Expand Down
Binary file added docs/assets/images/usecase_agentcore.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/en/DEPLOY_OPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,52 @@ const envs: Record<string, Partial<StackInput>> = {
}
```

### Enabling AgentCore Use Cases

This is a use case for integrating with agents created in AgentCore. (Experimental: Breaking changes may be made without notice)

Enabling `createGenericAgentCoreRuntime` will deploy the default AgentCore Runtime.
By default, it is deployed to the `modelRegion`, but you can override this by specifying `agentCoreRegion`.

With `agentCoreExternalRuntimes`, you can use externally created AgentCore Runtimes.

**Edit [parameter.ts](/packages/cdk/parameter.ts)**

```typescript
// parameter.ts
const envs: Record<string, Partial<StackInput>> = {
dev: {
createGenericAgentCoreRuntime: true,
agentCoreRegion: 'us-west-2',
agentCoreExternalRuntimes: [
{
name: 'AgentCore1',
arn: 'arn:aws:bedrock-agentcore:us-west-2:<account>:runtime/agent-core1-xxxxxxxx',
},
],
},
};
```

**Edit [packages/cdk/cdk.json](/packages/cdk/cdk.json)**

```json
// cdk.json

{
"context": {
"createGenericAgentCoreRuntime": true,
"agentCoreRegion": "us-west-2",
"agentCoreExternalRuntimes": [
{
"name": "AgentCore1",
"arn": "arn:aws:bedrock-agentcore:us-west-2:<account>:runtime/agent-core1-xxxxxxxx"
}
]
}
}
```

### Enabling Voice Chat Use Case

> [!NOTE]
Expand Down
Loading