Skip to content

Run Prompter locally

Run the full pipeline - ingestion, retrieval, answering, and optionally the Discord bot - on your own machine.

  • .NET SDK 10.0.301 or later
  • Docker (for Postgres with pgvector)
  • A Voyage AI API key (free tier, required for indexing)
  • An Anthropic API key (required for answering)
  • Optional: a Discord bot token for a private test server (only for running the bot itself)

From the repository root:

Terminal window
docker compose up -d

This starts Postgres with the pgvector extension on localhost:5432. The schema is created automatically on first run.

Set the keys as environment variables (or use a git-ignored Source/appsettings.Development.json - never commit keys):

Terminal window
export Cratis__Prompter__Voyage__ApiKey=<your-voyage-key>
export Cratis__Prompter__Anthropic__ApiKey=<your-anthropic-key>
Terminal window
cd Source
dotnet run -- index

This walks the cratis.io sitemap, fetches every page’s markdown mirror, chunks and embeds the content, and prints a summary line. A second run reports everything unchanged - only modified content is ever re-embedded.

Terminal window
dotnet run -- ask "How do I append an event in Chronicle?"
dotnet run -- ask "How do I append an event in Chronicle?" --verbose

The --verbose flag prints the retrieved passages with their scores before the answer - useful for judging retrieval quality. The command exits non-zero when Prompter refuses, so it works in scripts.

Create a bot application on a private test server first - the setup steps live in the repository’s Discord integration runbook. Then:

Terminal window
export Cratis__Prompter__Discord__Token=<your-test-bot-token>
dotnet run

The bot connects outward to Discord - no ports, tunnels, or public IP needed - and answers on your test server exactly as it would in production. See Configuration for every setting.