The core self-host stack (Documentation Index
Fetch the complete documentation index at: https://docs.3ngram.ai/llms.txt
Use this file to discover all available pages before exploring further.
docker compose up) runs the API and the MCP context
server without any connector dependencies or secrets. Integrations are
opt-in: they fail closed with setup guidance until you enable them
explicitly, so a fresh clone always boots.
There are two independent integration layers.
OAuth connectors (GitHub, Linear, Jira, Basecamp, Confluence, Google)
These index your existing tools into memories. They use only the core HTTP client (httpx), so there is no extra package to install — just enable the
module and supply provider OAuth credentials.
INTEGRATIONS_ENABLED=false (the default), the connector API endpoints
return a 400 with guidance instead of attempting a sync. Nothing about the
core context server depends on these connectors.
Chat-bot adapters (Telegram, Discord)
The Telegram webhook router and the Discord gateway worker depend on connector packages that are excluded from the core images to keepdocker compose up
slim. They live in the optional [integrations] install extra.
| Package | Adapter |
|---|---|
python-telegram-bot | Telegram webhook router (/api/bot/telegram/webhook), runs inside the API container |
discord.py | Discord gateway worker (scripts/run_discord_bot.py, Dockerfile.discord), a separate worker |
Telegram (in the API container)
The Telegram webhook is served by the API process, so the extra must be baked into the API image. The composeapi build accepts an API_EXTRAS build-arg —
set it to integrations and rebuild:
API_EXTRAS defaults to empty, so the core image stays slim unless you opt in.
For a non-compose build, pass it directly:
Discord (separate gateway worker)
The Discord worker has its own image (Dockerfile.discord) that already
installs the [integrations] extra. Build and run that worker, then set:
Local (non-Docker) installs
For a local checkout outside Docker, install the extra directly:Fail-closed behavior
If a bot code path is reached while its package is missing, 3ngram raises a503 (API) or exits with a clear message (Discord worker) telling you to
install the [integrations] extra — it never crashes the core flow with an
opaque ModuleNotFoundError. With BOT_ENABLED=false (the default), the bot
router never imports these packages at all.
What stays in core
aiohttp remains a core dependency: it is pulled in transitively by the LLM and
MCP stack and is used by the Slack/WhatsApp adapter helpers. It is therefore not
part of the optional extra.