Skip to content
reaatechREAATECH

Files · AWS Bedrock Multi‑Agent Handoff for Slack Support Triage

72 (1 binary, 491.0 kB total)attempt 1

README.md·2868 B·markdown
markdown
# AWS Bedrock Multi-Agent Handoff for Slack Support Triage
 
Triages incoming Slack support requests by automatically routing to specialist AI agents for billing, technical issues, or account management.
 
## Architecture
 
```
Slack Message


  Slack Bolt App (src/app.ts)


  ConfidenceRouter + KeywordClassifier (src/services/classifier.ts)
    │  classifies intent (billing / technical / account)

  TriageService (src/services/triage.ts)
    │  maps classification to specialist agent

  Specialist Agent (src/services/agents/specialists.ts)
    │  invokes Bedrock LLM via Converse API with runbook system prompt

  AgentResponse posted back to Slack channel
```
 
- **@reaatech/confidence-router** — Classifies incoming messages using keyword matching
- **@reaatech/agent-handoff-routing** — Scores and selects the best specialist agent via `CapabilityBasedRouter`
- **@reaatech/agent-mesh** — Provides shared types, Zod schemas (`ContextPacketSchema`, `AgentResponseSchema`)
- **@reaatech/agent-handoff** — Configures handoff timeouts and retry logic via `createHandoffConfig` and `withRetry`
- **@aws-sdk/client-bedrock-runtime** — Calls Bedrock LLM via the Converse API
- **@slack/bolt** — Receives Slack messages and posts responses via HTTPReceiver/Express
- **@reaatech/agent-memory** — Extracts and stores conversation facts for context across turns
- **langfuse** — LLM observability tracing
 
## Getting Started
 
```bash
pnpm install
cp .env.example .env
# Fill in your environment variables
pnpm dev
```
 
## Environment Variables
 
See `.env.example` for all required variables.
 
| Variable | Description |
|---|---|
| `SLACK_BOT_TOKEN` | Slack bot token (starts with `xoxb-`) |
| `SLACK_SIGNING_SECRET` | Slack app signing secret |
| `AWS_REGION` | AWS region for Bedrock (e.g. `us-east-1`) |
| `AWS_ACCESS_KEY_ID` | AWS access key |
| `AWS_SECRET_ACCESS_KEY` | AWS secret key |
| `OPENAI_API_KEY` | OpenAI API key (used by AgentMemory embedding) |
| `LANGFUSE_PUBLIC_KEY` | Langfuse project public key |
| `LANGFUSE_SECRET_KEY` | Langfuse project secret key |
| `LANGFUSE_HOST` | Langfuse host URL |
| `PORT` | Slack Bolt HTTP listener port (default: 3000) |
| `BEDROCK_MODEL_ID` | Bedrock model ID (default: `anthropic.claude-sonnet-4-v1:0`) |
 
## Slack App Setup
 
1. Create a Slack app at https://api.slack.com/apps
2. Enable **Events** and subscribe to `message.channels` and `message.im`
3. Set the Request URL to your deployed endpoint `/api/slack/events`
4. Install the app to your workspace
5. Copy the Bot Token and Signing Secret to `.env`
 
## Scripts
 
- `pnpm dev` — Start Next.js dev server
- `pnpm build` — Build for production
- `pnpm typecheck` — Run TypeScript type checking
- `pnpm lint` — Run ESLint
- `pnpm test` — Run vitest with coverage
 
## License
 
MIT