answerLoops
Open-source AI support agent for your community. Auto-answers repeat questions in Discord, Slack, Discourse, GitHub, Telegram & email from your own docs — only when confident, escalates the rest. Self-hostable. MCP server + REST API.
Documentation
AnswerLoops — AI support that lives in your community
Your community asks the same questions every day. AnswerLoops answers them in the channel, and only when it has a good answer.
Most communities have the same problem: the same questions come up over and over in Discord, in Slack, on the forum, in the issue tracker, and someone on the team answers them again. AnswerLoops takes the first pass. It watches the channels you connect, checks each new question against your docs and your past answers, and replies in the thread when it can. When it can't, it hands the question to a person with a draft already written.
It's for teams whose support happens in public: software and API companies, open-source projects, course creators running a paid community, game studios with a player Discord, DAOs. If your users ask for help in a chat channel instead of a ticket form, this fits. If you run a Zendesk-style help desk, it probably doesn't.
What matters is the step before a reply goes out. Every draft is scored by a second pass that checks it against the evidence it used. Answers that clear your threshold post on their own. Anything shaky waits in a queue for a human, with the context and the draft attached. You set where the line is.
Answers don't disappear when a ticket closes. A good one can go back into the knowledge base; a bad one gets down-voted and drops out of search. The knowledge-gaps view shows which questions the system still can't answer, so you know what to write next.
What you get
| 01 | A confidence gate | A second pass decides whether an answer posts or goes to a human. You set the threshold. Bug reports and feature requests always stay human-led. |
|---|---|---|
| 02 | One pipeline for every channel | Discord, Slack, Discourse and Circle forums, GitHub Issues and Discussions, Telegram, email, web chat, and Google Chat all land in the same ticket model, scoped to your org. |
| 03 | Answers grounded in your content | Search runs across crawled docs, uploaded files, published KB articles, resolved tickets, and connected GitHub repos. |
| 04 | Your choice of model | OpenAI, Anthropic, Google Gemini, Groq, Mistral, Ollama, or any OpenAI-compatible endpoint, on your own key. |
| 05 | Access for agents | The same knowledge and workflows are exposed over MCP JSON-RPC and a REST API with an OpenAPI schema. |
| 06 | You run it | The app, the listener, and Postgres are yours. Tenant data is scoped by organization and integration credentials are encrypted at rest. |
How the loop works
The pipeline lives in `lib/ingest/pipeline.ts`. Each channel adapter only handles its own auth, message parsing, and reply delivery. Everything after that — ticket creation, retrieval, drafting, review, analytics, escalation — is the same code regardless of where the question came from.
What ships in the repository
Channels and conversations
- Discord text channels, forum threads, reactions, slash commands, and multiple connected servers
- Slack Events API or polling mode, plus in-thread replies
- Discourse and Circle forum ingestion and replies
- Google Chat space pairing and replies
- GitHub Issues, issue comments, Discussions, discussion comments, and repository sync
- Telegram webhook ingestion and replies
- Provider-agnostic inbound email, threaded replies, and Gmail or Outlook send-only OAuth
- Embeddable website chat with lead capture and a published-KB-only retrieval boundary
Knowledge and automation
- Website crawling, GitHub repository sync, Notion workspace sync, and PDF, DOCX, Markdown, text, or CSV uploads
- Semantic search over KB articles and resolved support history
- AI triage, priority, category, SLA deadlines, grounded drafting, and confidence review
- Configurable auto-deflection, human escalation, CSAT feedback, and simulation mode
- Knowledge-gap reporting and FAQ generation
Product and platform
- Unified inbox, ticket detail timeline, live updates, analytics, ROI estimates, and CSV exports
- Organizations, roles, invitations, onboarding, per-org API keys, and tenant-isolated data access
- Browser push and email notifications
- Hosted billing support plus a complete self-hosted deployment path
- MCP tools and REST endpoints for KB search, FAQs, tickets, and answer generation
See the unified inbox
See confidence review and escalation
Run it locally
Docker Compose is the quickest way to get everything up. It starts the Next.js app, the channel listener, and PostgreSQL, and runs the Drizzle migrations for you.
Prerequisites
- Docker Engine with Docker Compose
- A Google OAuth client for dashboard sign-in
- An API key for one supported AI provider
1. Clone and configure
git clone https://github.com/answerLoops/answerLoops.git
cd answerLoops
cp .env.example .envGenerate independent secrets:
openssl rand -hex 32 # AUTH_SECRET
openssl rand -hex 32 # ENCRYPTION_KEY
openssl rand -hex 32 # BOT_SECRETThen set at least these values in `.env`:
AUTH_URL=http://localhost:3000
AUTH_SECRET=
ENCRYPTION_KEY=
BOT_SECRET=
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
OPENAI_API_KEY=Use `http://localhost:3000/api/auth/callback/google` as the Google OAuth redirect URI. The development Compose file supplies the local `DATABASE_URL`; configure a real Postgres URL separately for production.
2. Start the stack
docker compose up --buildOpen http://localhost:3000, sign in, and complete onboarding. To verify the server independently:
curl http://localhost:3000/api/health
# {"ok":true}> [!WARNING]
> `docker compose down` stops the stack and preserves your database. Adding `-v` deletes the named Postgres volume and its data.
For deployment, provider-specific setup, and every environment variable, follow the self-hosting documentation.
Native development
You'll need Node.js 20.9 or newer and pnpm. Running Postgres in Docker while the app processes run on the host works well:
docker compose up -d postgres
pnpm install
cp .env.example .env.localSet `DATABASE_URL=postgresql://community:community@localhost:5432/community` and the required values above in `.env.local`. Next.js loads that file for the web app. To run both the web app and listener from the same shell, export it first:
set -a
source .env.local
set +a
pnpm dev:allThe main development commands are:
| Command | Purpose |
|---|---|
| `pnpm dev` | Start the Next.js development server |
| `pnpm bot` | Start the Discord/Slack listener in watch mode |
| `pnpm dev:all` | Run the app and listener together |
| `pnpm lint` | Run Oxlint |
| `pnpm test` | Run the Vitest unit and integration suite |
| `pnpm test:e2e` | Run Playwright end-to-end tests |
| `pnpm test:e2e:typecheck` | Type-check the Playwright suite |
| `pnpm build` | Create the production Next.js build |
Repository map
app/ Next.js pages, server actions, webhooks, REST, and MCP
bot/ Discord gateway and Slack polling listener
components/ Dashboard, onboarding, marketing, and widget UI
lib/ai/ Retrieval, agents, embeddings, triage, and review
lib/ingest/ Shared multi-channel support pipeline
lib/db/ Drizzle schema, migrations, and org-scoped queries
content/docs/ Fumadocs product, integration, and self-hosting docs
drizzle/ Ordered PostgreSQL migrations
tests/unit/ Vitest regression and component tests
e2e/ Playwright end-to-end coverage
public/widget.js Embeddable widget loaderProduction is two processes — `app` and `bot` — built from one multi-stage image, with PostgreSQL behind them. `ARCHITECTURE.md` goes through the pipeline and the data model in detail.
Build with the APIs
Create an organization API key in Settings → API Keys, then use either surface:
| Surface | Endpoint | Best for |
|---|---|---|
| MCP | `POST /api/mcp` | Claude, Cursor, and other MCP-compatible agents |
| REST | `/api/agent/*` | Services, scripts, and custom integrations |
| OpenAPI | `GET /api/agent/openapi.json` | Typed clients and API exploration |
Both cover knowledge-base search, FAQ lookup, listing and creating tickets, and generating a grounded answer. See the MCP guide or the Agent API reference.
Contributing
We're getting the project ready for a wider release. Contributions are welcome. A few things to know first:
1. Open or link an issue so we agree on the behavior before you build it.
2. Every data-access path has to scope by organization. Don't merge one that doesn't.
3. Behavior changes need test coverage.
4. Run `pnpm lint`, `pnpm test`, and `pnpm build` before you push.
5. If you change product behavior, architecture, setup, or an integration, update the matching page under `content/docs/`.
Found a security issue? Follow `SECURITY.md`. Don't open a public issue for it.
License
AGPL-3.0. Read it, change it, run it yourself. If you run a modified version as a network service, the AGPL says you have to make your source available to its users.
Frequently asked questions
What is answerLoops?
answerLoops is Open-source AI support agent for your community. Auto-answers repeat questions in Discord, Slack, Discourse, GitHub, Telegram & email from your own docs — only when confident, escalates the rest. Self-hostable. MCP server + REST API.
How do I install answerLoops?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is answerLoops open source?
Yes — it is hosted on GitHub at https://github.com/answerLoops/answerLoops and has 4 stars.
Related MCP tools
The go-to web for your AI coding agent — local-first search, fetch, crawl & research over MCP. No API keys, no cloud, $0/query. Public beta.
📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Lan...
The TypeScript AI agent framework. ⚡ Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. Built for the Model Context Protocol to enh
A mcp server to allow LLMS gain context about shadcn ui component structure,usage and installation,compaitable with react,svelte 5,vue & React Native
Official Microsoft Learn MCP Server and CLI tool – powering LLMs and AI agents with real-time, trusted Microsoft docs & code samples.
FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, ...
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP