Discord bot for recalling previously answered questions.
- Node.js 20+
- Docker Desktop (for the TimescaleDB + pgai stack)
- Ollama with the host reachable at
http://localhost:11434- The bot pulls
gpt-oss:120b-cloudon startup]
- The bot pulls
- The token for a Discord app with suitable permissions
-
Install dependencies
npm install
-
Create
.envfrom.env.exampleand fill in:TOKENDEV_GUILD_IDS(optional)DATABASE_URL(defaults topostgres://postgres:postgres@localhost:5432/postgres)
-
Launch the database + vector stack
npm run dc:up
-
Apply migrations and generate Prisma client/typed SQL
npm run prisma:migrate
-
Start the bot
npm run dev
npm run dev– tsx watch mode for developmentnpm run build– type-check and emit JS todist/npm start– run the compiled buildnpm run dc:up/npm run dc:down– manage the Docker compose stacknpm run prisma:generate– regenerate Prisma client and typed SQL helpers
src/app– commands, events, components, taskssrc/core– configuration, logging, registry, error handlingsrc/lib– reusable libraries (scheduler, health checks, LLM stack, Result helpers)src/services– Prisma-backed domain services (guild & topic management)src/db/prisma– Prisma schema, migrations, typed SQLsrc/db/init– database bootstrap scripts (pgai / Ollama integration)