{"id":47566439,"url":"https://github.com/mikegc-aws/async-agentic-tools","last_synced_at":"2026-04-14T01:00:31.450Z","repository":{"id":339128821,"uuid":"1159857523","full_name":"mikegc-aws/async-agentic-tools","owner":"mikegc-aws","description":"True async agentic tools —    the model keeps talking while tools run in the background","archived":false,"fork":false,"pushed_at":"2026-02-18T06:02:47.000Z","size":117,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T10:31:46.000Z","etag":null,"topics":["ai-agents","amazon","async","aws","python","strands-agents"],"latest_commit_sha":null,"homepage":"","language":"Python","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/mikegc-aws.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2026-02-17T08:48:59.000Z","updated_at":"2026-02-18T09:16:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mikegc-aws/async-agentic-tools","commit_stats":null,"previous_names":["mikegc-aws/async-agentic-tools"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mikegc-aws/async-agentic-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegc-aws%2Fasync-agentic-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegc-aws%2Fasync-agentic-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegc-aws%2Fasync-agentic-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegc-aws%2Fasync-agentic-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikegc-aws","download_url":"https://codeload.github.com/mikegc-aws/async-agentic-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegc-aws%2Fasync-agentic-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31777348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["ai-agents","amazon","async","aws","python","strands-agents"],"created_at":"2026-03-30T06:00:24.600Z","updated_at":"2026-04-14T01:00:31.413Z","avatar_url":"https://github.com/mikegc-aws.png","language":"Python","funding_links":[],"categories":["Community Projects"],"sub_categories":["For PyPI Packages"],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🧰⛓️‍💥 async-agentic-tools\n\n[![GitHub stars](https://img.shields.io/github/stars/mikegc-aws/async-agentic-tools.svg)](https://github.com/mikegc-aws/async-agentic-tools/stargazers)\n[![License](https://img.shields.io/github/license/mikegc-aws/async-agentic-tools.svg)](https://github.com/mikegc-aws/async-agentic-tools/blob/main/LICENSE)\n[![Python](https://img.shields.io/badge/python-3.14%2B-blue.svg)](https://python.org)\n\nTrue asynchronous agentic tools — the model dispatches a tool, gets an immediate acknowledgement, and keeps talking. Results are delivered via callback when they complete — no blocked loops, no dead air.\n\n\u003c/div\u003e\n\nThis is **not** parallel tool calling (which most agent frameworks already support). Parallel tool calling still blocks the agent loop until every tool in the batch returns. This is true async: the model stays responsive while tools run in the background, and results stream in as they finish.\n\nThe demo is built on [Strands Agents](https://github.com/strands-agents/sdk-python), but the pattern applies to any agent framework with a tool-calling loop.\n\nRead the [blog post](https://blog.mikegchambers.com/posts/async-agentic-tools/) for the full explanation of the problem and how this works.\n\n**Quick walkthrough video here:** \"Do async tool calls work now???\"\n[![Watch the video](https://img.youtube.com/vi/VYLBCoxbPE8/maxresdefault.jpg)](https://youtu.be/VYLBCoxbPE8)\n\n## How it works\n\nThree small components layer on top of a standard Strands Agent:\n\n- **`@tool_async(manager)`** — Decorator that wraps any tool function. The tool is submitted to a background thread and returns a task ID immediately. Your tool code doesn't change at all.\n- **`AsyncToolManager`** — Manages a thread pool, tracks pending tasks, and fires a callback when each one completes.\n- **`AsyncAgent`** — Wraps a Strands `Agent` to handle result delivery. If the agent is idle when a result arrives, it's delivered immediately. If the agent is busy, results queue up and drain when it finishes.\n\n```python\nfrom strands import Agent\nfrom strands_async_tools import AsyncAgent, AsyncToolManager, tool_async\n\nmanager = AsyncToolManager(max_workers=4)\n\n@tool_async(manager)\ndef slow_research(topic: str) -\u003e str:\n    \"\"\"Research a topic thoroughly.\"\"\"\n    # This runs in a background thread — takes as long as it needs\n    time.sleep(15)\n    return f\"Findings about {topic}...\"\n\nagent = Agent(model=model_id, tools=[slow_research])\nasync_agent = AsyncAgent(agent=agent, manager=manager)\nasync_agent.send(\"Research quantum computing\")\n```\n\nThe framework is about 320 lines of Python across three files in `strands_async_tools/`.\n\n## Prerequisites\n\n- Python 3.14+\n- [uv](https://docs.astral.sh/uv/) (recommended)\n- AWS credentials configured for [Amazon Bedrock](https://aws.amazon.com/bedrock/)\n\n## CLI demo\n\nAn interactive chat with three simulated async tools (10-20s delays each) and two synchronous tools from `strands-agents-tools` (calculator, current_time).\n\n```bash\ngit clone https://github.com/mikegc-aws/async-agentic-tools\ncd async-agentic-tools\nuv run python demo.py\n```\n\nThe default model is Claude Sonnet on Bedrock. Override with the `STRANDS_MODEL` env var.\n\nTry something like:\n\n```\nYou: Research Paris\n\n  [thinking] processing...\nI've started researching Paris for you (Task a1b2c3).\nI'll let you know as soon as the results come in.\n\nYou: What time is it there?\n\n  [thinking] processing...\nIt's currently 15:32 in Paris (CET, UTC+1).\n\n  [callback] research_topic (a1b2c3) completed in 16482ms — delivering to agent now\n  [thinking] processing...\nThe Paris research just came back! Here are some highlights:\n- ...\n```\n\nThe async tool dispatches to a background thread and the agent keeps talking. The sync tool (current_time) returns instantly — and the agent knows \"there\" means Paris. When the research finishes, the result is delivered via callback and the agent speaks it.\n\n## Voice mode (experimental)\n\nThe `voice/` folder contains a voice interface using **Amazon Nova Sonic** (bidirectional streaming voice model). The agent talks to you through your speakers and listens through your microphone. While you chat, it can delegate complex tasks (web research, file I/O) to a background subagent via `@tool_async`. Results are injected back into the voice stream — the agent speaks them to you when they're ready.\n\n### Voice requirements\n\n- AWS credentials with Bedrock access in `us-east-1`\n- Microphone and speakers\n- Model access for `amazon.nova-2-sonic-v1:0`\n- **Tavily API key** (optional but recommended) — the subagent uses [Tavily](https://tavily.com/) for web search and extraction. You can get a free API key at [app.tavily.com](https://app.tavily.com/). Without it, the voice agent works but can't do web searches.\n\n### Running voice mode\n\nFrom the repo root:\n\n```bash\n# With web search (recommended)\nTAVILY_API_KEY=tvly-your-key-here uv run python -m voice\n\n# Without web search (still works, just no web research)\nuv run python -m voice\n```\n\nSpeak into your microphone. The agent responds through your speakers with echo cancellation (LiveKit WebRTC APM). Press `Ctrl+C` to quit.\n\n### Voice env vars\n\n| Variable | Default | Description |\n|---|---|---|\n| `AWS_REGION` | `us-east-1` | AWS region for Bedrock |\n| `NOVA_SONIC_VOICE` | `tiffany` | Nova Sonic voice name |\n| `NOVA_SONIC_MODEL` | `amazon.nova-2-sonic-v1:0` | Nova Sonic model ID |\n| `SUBAGENT_MODEL` | `us.anthropic.claude-sonnet-4-20250514-v1:0` | Subagent Bedrock model |\n| `TAVILY_API_KEY` | _(none)_ | Tavily API key for web search |\n| `LOG_FILE` | `voice_debug.log` | Debug log path |\n| `LOG_LEVEL` | `WARNING` | Console log level |\n\nSee [voice/README.md](voice/README.md) for more detail on the voice architecture.\n\n## Project structure\n\n```\nstrands_async_tools/          # The framework (3 files, ~320 lines)\n  manager.py                  # AsyncToolManager — thread pool + callbacks\n  decorator.py                # @tool_async — decorator for async tools\n  agent.py                    # AsyncAgent — callback-driven result delivery\n\ndemo.py                       # Interactive CLI demo (simulated async tools)\ndemo_sync.py                  # Synchronous comparison demo\n\nvoice/                        # Experimental voice interface\n  voice.py                    # BidiAgent + Nova Sonic + async result injection\n  subagent.py                 # Background agent with real tools (web search, file I/O)\n  echo_cancel.py              # Echo cancellation (LiveKit WebRTC APM)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikegc-aws%2Fasync-agentic-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikegc-aws%2Fasync-agentic-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikegc-aws%2Fasync-agentic-tools/lists"}