Skip to content

vinit-agr/slackbot-asimov

Repository files navigation

Slack Bot Adaptor

A TypeScript-based Slack bot that acts as an adaptor for an external Conversational AI Agent.

Features

  • Listens for mentions and monitored threads.
  • Responds to DMs automatically.
  • Summarizes long threads (Head + Tail).
  • Caches User and Channel names in Redis.
  • Connects to an external AI API for intelligence.
  • Dockerized setup.

Setup

  1. Environment Variables: Copy env.example to .env and fill in your Slack credentials and External Agent URL.

    cp env.example .env
    
  2. Docker: Run the app and Redis with Docker Compose (V2).

    docker compose up --build
    
  3. Local Development:

    • Install dependencies: npm install
    • Start Redis locally (or via Docker).
    • Run dev server: npm run dev

Architecture

  • src/app.ts: Entry point.
  • src/listeners/: Event handlers for mentions and messages.
  • src/services/: Core logic (Cache, Context, Slack, Agent).

External API Contract

The bot sends a POST request to AGENT_API_URL with:

{
  "thread_id": "167890.12345",
  "messages": [
    { "role": "user", "name": "Alice", "content": "Hello", "timestamp": "..." },
    ...
  ],
  "is_direct_mention": true
}

The Agent should return JSON:

{
  "response": "Hello Alice!",
  "should_respond": true
}

(Or just {"text": "Hello Alice!"})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors