Prompt Packs¶
MiniBot composes the system prompt from a base file plus runtime fragments.
Base System Prompt¶
File-based (default): loaded from
./prompts/main_agent_system.md(configurable viallm.system_prompt_file).Inline fallback: set
llm.system_prompt_file = null(or empty string) to usellm.system_promptinstead.Fail-fast: if
system_prompt_fileis configured but the file is missing or empty, the daemon will fail at startup.
Runtime Fragments¶
Channel-specific: place channel fragments at
prompts/channels/<channel>.md(e.g.prompts/channels/telegram.md).Policy fragments: add files under
prompts/policies/*.mdfor cross-channel rules (loaded in sorted order). Every file in the directory is loaded unconditionally — the loader globs the directory and never inspects which tools are attached. Prompt text such as “applies when thegraph_*tools are attached” is guidance addressed to the model, not a condition the loader evaluates. For a fragment that must appear only when a given tool is attached, add a gated_<name>_fragment()method tominibot/app/handlers/services/prompt_service.pyinstead (see_skill_catalog_fragmentfor the pattern).Composition order: base prompt → policy fragments → specialist roster → skill guidance (with a catalog snapshot when
preload_catalogis on) → runtime capability status → channel fragment → environment context → tool safety addenda.Prompts directory: configure root folder with
llm.prompts_dir(default:./prompts).
Shipped prompt files¶
The default ./prompts tree ships seven files, each playing one role in the composed
prompt (or the compaction pass):
File |
Role |
|---|---|
|
Base system prompt — persona and ground rules |
|
Cross-channel delegation policy |
|
Cross-channel relation-graph vs durable-memory routing policy |
|
Cross-channel tool routing policy |
|
Telegram channel fragment |
|
Console channel fragment |
|
Memory-compaction pass instructions |
prompts/main_agent_system.mdThe identity and ground rules: “You are Minibot, a self-hosted personal AI assistant.” It covers privacy/secrets hygiene, directness, act-now-over-narrate execution, and the durable-memory workflow (search before create, update matching entries, persist only confirmed facts). Loaded as the base fragment via
llm.system_prompt_file(default./prompts/main_agent_system.md); startup fails fast if the file is missing or empty.prompts/policies/*.mdCross-channel rules appended right after the base prompt, in alphabetical order, regardless of the active channel and regardless of which tools are attached.
delegation.md— keep trivial requests local; preferdelegate(result needed) orspawn_task(final answer) for multi-step specialist work; usefetch_agent_infowhen the roster description is not enough; never claim a delegated result, since it arrives as a later message; continue locally when delegation is unavailable or fails.graph.md— decide between the relationgraph_*tools and the durablememory_*tools: a fact naming two things is an edge and belongs in the graph. Note this fragment ships even when thegraph_*tools are disabled; it relies on the model no-opping when the tools are absent.tool_usage.md— route the model to the right tool:memory_*vshistory,apply_patchfor existing-file edits vswrite_file/move_file/delete_filefor file management, reuse canonical path fields from tool output, absolute paths in yolo mode.
prompts/channels/<channel>.mdChannel-specific formatting and capabilities, appended only when that channel is active.
telegram.md— enforce Telegram Bot API formatting: plain text, Telegram-compatible inline HTML, or Markdown (no web HTML, no JSON wrappers like{"answer": ...}); when delegation results containattachments, send each withsend_fileand confirm briefly.console.md— text-only interface: always usekind="text", report file paths in the reply instead of sending files, and never callsend_file.
prompts/compact.mdInstructions for the memory-compaction pass: produce an information-dense summary with labeled sections (Goals / Progress / Decisions / Constraints / Context / Next), retain relevant context over aggressive shortening, and drop chit-chat and tangents. It is concatenated after the base system prompt whenever a turn triggers compaction; if the file is missing, a built-in one-liner summary prompt is used instead.
Editing the System Prompt¶
Edit
prompts/main_agent_system.md.Review for content, security, tone, and absence of secrets.
Commit with a descriptive message.
Deploy via Docker or systemd — both setups include the
prompts/directory automatically.