Skip to content

innovationtreehouse/arbor

Repository files navigation

Arbor

Arbor runs Squirrel, a Slack bot that uses the Claude Agent SDK to answer questions by searching Google Drive, GitHub repositories, and a curated set of web URLs. Mention @Squirrel in any thread and it will research your question and reply in the same thread.

Documentation

Project Structure

packages/
  db/              # UrlStore abstraction + PostgresUrlStore (Drizzle ORM)
  lambda/          # Slack webhook receiver (AWS Lambda + API Gateway)
  agent/           # AI research agent (ECS Fargate, long-running)
  mcp-url-fetcher/ # Custom MCP server for allowlisted URL fetching

Prerequisites

  • Node.js 20+
  • AWS account with permissions for Lambda, ECS, SQS
  • PostgreSQL 14+ database accessible from Lambda and ECS
  • Slack workspace with a bot app configured (Events API + slash commands)
  • Anthropic API key
  • Google service account with Drive API access
  • GitHub personal access token

Setup

1. Install dependencies

npm install

2. Configure environment variables

See Runtime Configuration for the full reference. The variables that must be set before the app will start are summarised below.

LambdaSLACK_SIGNING_SECRET, DATABASE_URL, SQS_QUEUE_URL, ECS_CLUSTER, ECS_TASK_FAMILY, ECS_TASK_DEFINITION, SUBNET_IDS, SECURITY_GROUP_IDS, ADMIN_USER_IDS

AgentANTHROPIC_API_KEY, SLACK_BOT_TOKEN, DATABASE_URL, SQS_QUEUE_URL, AWS_REGION, GOOGLE_CREDENTIALS, GITHUB_TOKEN

3. Build

npm run build

4. Deploy

Deployment is not yet automated. The recommended approach is:

  1. Provision a PostgreSQL database (e.g. RDS) and create the url_config table — see the schema in docs/operation.md.
  2. Package packages/lambda/dist/ as a Lambda ZIP and deploy behind API Gateway (HTTP API).
  3. Build and push the Docker image from packages/agent/Dockerfile to ECR.
  4. Create an ECS task definition referencing that image, a Fargate service, and the SQS queue.

5. Configure Slack

  1. Enable the Events API and point the Request URL to https://<your-api-gateway>/slack/events.
  2. Subscribe to the app_mention bot event.
  3. Add a Slash Command /squirrel-admin pointing to https://<your-api-gateway>/slack/commands.
  4. Invite the bot to channels where you want to use it.

6. GitHub Actions secrets

See GitHub Actions Configuration. Required: ANTHROPIC_API_TOKEN and AGENT_TOKEN (PAT with repo scope).

Development

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Watch mode
npm run test:watch

License

MIT — see LICENSE.

About

ARBOR™ -- Agentic Resilient Business Operations Resource

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors