Skip to main content

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.

The core self-host stack (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=true
# plus the per-provider OAuth client id/secret env vars for the connectors you use
When 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 keep docker compose up slim. They live in the optional [integrations] install extra.
PackageAdapter
python-telegram-botTelegram webhook router (/api/bot/telegram/webhook), runs inside the API container
discord.pyDiscord 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 compose api build accepts an API_EXTRAS build-arg — set it to integrations and rebuild:
API_EXTRAS=integrations docker compose build api migrations
docker compose up
API_EXTRAS defaults to empty, so the core image stays slim unless you opt in. For a non-compose build, pass it directly:
docker build -f backend/Dockerfile.api --build-arg API_EXTRAS=integrations -t engram-api ./backend
Then enable the bot module and configure the Telegram secrets:
BOT_ENABLED=true
TELEGRAM_BOT_TOKEN=...
TELEGRAM_WEBHOOK_SECRET=...   # required when TELEGRAM_BOT_TOKEN is set

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:
BOT_ENABLED=true
DISCORD_BOT_TOKEN=...

Local (non-Docker) installs

For a local checkout outside Docker, install the extra directly:
# from backend/
uv sync --extra integrations
# or, for a plain pip install
pip install 'engram[integrations]'

Fail-closed behavior

If a bot code path is reached while its package is missing, 3ngram raises a 503 (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.