Run Prompter locally
Run the full pipeline - ingestion, retrieval, answering, and optionally the Discord bot - on your own machine.
Prerequisites
Section titled “Prerequisites”- .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)
Bring up the database
Section titled “Bring up the database”From the repository root:
docker compose up -dThis starts Postgres with the pgvector extension on localhost:5432. The schema is created automatically on
first run.
Configure your keys
Section titled “Configure your keys”Set the keys as environment variables (or use a git-ignored Source/appsettings.Development.json - never
commit keys):
export Cratis__Prompter__Voyage__ApiKey=<your-voyage-key>export Cratis__Prompter__Anthropic__ApiKey=<your-anthropic-key>Index the documentation
Section titled “Index the documentation”cd Sourcedotnet run -- indexThis 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.
Ask from the terminal
Section titled “Ask from the terminal”dotnet run -- ask "How do I append an event in Chronicle?"dotnet run -- ask "How do I append an event in Chronicle?" --verboseThe --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.
Run the Discord bot
Section titled “Run the Discord bot”Create a bot application on a private test server first - the setup steps live in the repository’s Discord integration runbook. Then:
export Cratis__Prompter__Discord__Token=<your-test-bot-token>dotnet runThe 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.