Skip to content

Customize Instructions and Prompts

Use Settings -> Instructions to set personal preferences for how Numi responds to you. Editing the server's base system prompt in code is only needed when changing default behavior for every user on the instance.

Set your personal instructions

  1. Open your profile menu at the bottom of the sidebar and select Settings.
  2. Select Instructions and enter your standing preferences, for example:
Keep answers concise. Use metric units. For code changes, include the command to verify the result.
  1. Click Save Changes.
  2. Start a new chat and send a test question to verify the behavior.

Personal instructions are saved per account and take effect on the next model request. Keep this field focused on response style, formatting, and workflow preferences; factual background about your projects and stack is handled automatically by Memory.

You can also update personal instructions through the settings API:

curl -X POST http://localhost:4567/api/v1/me/settings \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"personal_preferences": "Keep answers concise. Use metric units."}'

Developer: change the base system prompt

Shared instance instructions live as constants in src/numi_chat/agent/prompt_builder.py, where _base_system_sections() defines their order and build_system_prompt() assembles the system message.

  1. Edit the section constant that governs the behavior you want to adjust (such as TONE_AND_STYLE).
  2. Preserve the citation and tool-result formatting rules: the web UI relies on markers such as [web:1], [file:2], and grouped [web:1, web:2] tags to link inline claims to source cards.
  3. Restart or redeploy the server and start a New Chat to test (existing chats keep the system message that was stored when they were created).

How the prompt is assembled

Numi structures outgoing messages so the prompt only grows at the end, keeping historical message bytes identical across turns so provider prompt caches stay valid:

Component Contents Where it is built
Stored system message Shared assistant instructions, formatting, citation, and tool rules build_system_prompt() in prompt_builder.py
Opening session context (prepended to the first user message) Account instructions and selected memory (<user_context>), active model identity (<active_model>), uninstalled optional tool groups (<optional_tools>), and available skills (<available_skills>) context_layers.py and Agent._first_user_context()
Per-turn user envelope (stored with each user message) The user's message (<user_query>), uploaded-file metadata and bounded PDF excerpts (build_additional_data_section()), and the message's send timestamp (<current_time>... UTC</current_time>, stored as a time_note part) Agent._persist_user_turn() and context_layers.current_time_note()

Because the opening <user_context> block contains no live wall-clock timestamp and each user message replays its own recorded <current_time> note, replaying prior turns sends the exact same prefix bytes on every follow-up turn.

Limits and troubleshooting

By default, personal instructions are capped at PROMPT_MAX_PREFERENCE_CHARS (2,500 characters); longer text is truncated when building <user_context>. See Prompt settings for all prompt and history character budgets.