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 the Cratis server (only for running the bot itself)
Before starting an answer-enabled host, explicitly set the scalar
Cratis__Prompter__Protection__ConfiguredAllowedGuilds=1182595891576717413. This is required even when
using only the terminal: the bot and the ask, index, and eval commands share the startup check. The
migrate command is separate. Only the Cratis guild is allowed, with no local or Development exemption.
If answering is disabled, the guild list may be empty, but it cannot name a different guild, and
admission remains disabled.
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”Follow Set up the Discord app for the application and Cratis guild configuration. The same guild restriction applies to this locally hosted bot. 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 only in the allowed Cratis guild. Local hosting does not enable a separate private test guild. See Configuration for every setting.