Mahal Systems

Overview › 3Prompts › a.Structuring

Structuring

Clarify structure and intent. 4 optimizations.

  1. i.

    Add worked examples to the prompt (few-shot), or curated example queries for data agents

    Put a few solved examples of the task in the prompt (the input and the exact output wanted), or give a data agent commented example queries for its custom metrics and an index of past queries it retrieves per question.

    Mixed qualityHigher costSlower

    Tier 3 · tuning · changes prompt · any agent · 7 sources, 6 measured

  2. ii.

    Avoid few-shot ruts

    An agent's own history, and any examples in its prompt, act as few-shot demonstrations: when the context fills with near-identical action-observation pairs (twenty similar items in a row, a retried call), the model tends to copy their surface form instead of judging the current item.

    Mixed qualityMixed cost

    Tier 3 · tuning · changes prompt · any agent · 13 sources, 8 measured

  3. iii.

    Dynamic context injection

    Put the runtime facts the model cannot know into its context each run: today's date and timezone, the working directory, OS and git state, the tools available, the user and locale.

    Better for brandMixed quality

    Tier 3 · tuning · changes prompt, context · any agent · 9 sources, 4 measured

  4. iv.

    Restructure the system prompt: every requirement once, up front, in named sections; nothing the model doesn't need

    Rewrite the system prompt so that each requirement the task has (constraints, the answer format, the completion check, how to work efficiently, the domain procedure) is stated once, up front, in a named section, and remove instructions the model does not need.

    Lower costFasterMixed quality

    Tier 3 · tuning · changes prompt · any agent · 11 sources, 2 measured

See also

  1. 9.b.i

    Make the final answer reliably extractable: state the format, extract robustly, force an answer at the limit

    State the required answer format in the prompt, and make the harness extract it robustly: strip markers, normalize numbers, detect refusals, and force a best-effort answer when the loop ends on a budget rather than returning nothing.

    Verification › Confirming completion

    Better quality

    Tier 2 · reliability · changes control flow, prompt · structured output agents · 4 sources

Before you go...

Build better agents, weekly

Our latest research, performance benchmarks, optimization strategies, and updates around AOT development.

One email a week, nothing else. Unsubscribe anytime.