awslabs / awslabs/bedrock-agentcore-samples-typescript

feat: Add background workers agent example

Open
#16 0 comments 0 reactions 1 assignee Claimed by @cerashdan View on GitHub
area:runtime enhancement
Dominant language
TypeScript
Stars
22
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### Description

The current async agent example showcases the basic usage of AgentCore async task management capability. It demonstrate the use of addAsyncTask and completeAsyncTask which effectively update the agent ping state from Healthy to HealthyBusy. These work very well for non-blocking I/O tasks in nodejs event loop.

This new example will demonstrate how you can use define a tool that will spawn a new thread and use message passing to notify AsyncTask completion. This is beneficial for CPU-blocking operation using a separate thread to keep the agent responding even while doing a CPU blocking operation (e.g. analyzing a file or resizing an image).

### Use case

This new example will demonstrate the use of CPU-blocking operation using a separate thread to keep the agent responding even while doing a CPU blocking operation (e.g. analyzing a file or resizing an image).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.