Skip to content

[V1.3.4] Prompt Optimizations #322

@ahmad-ajmal

Description

@ahmad-ajmal

Prompt optimization, version control & profiling

Problem

Prompts in agent_core/core/prompts/ have grown to ~1,600 lines with
duplicated instructions and dead fragments. We pay for this bloat on every
LLM call, prompt edits are buried in unrelated code diffs, and we have no
way to measure if a change helped.

Goals

  • Chunk prompts into reusable fragments (role, policy, action-space, etc.)
    so shared text is defined once.
  • Dedupe & prune redundant instructions and unused constants.
  • Version control each prompt as a first-class unit — every prompt gets a
    name + version, and changes are independently diffable, revertible, and
    trackable (not lost inside larger code commits). Built on top of the
    existing PromptRegistry.
  • Profile token cost per prompt and add a basic quality eval so changes
    report a delta, not vibes.

Acceptance criteria

  • Prompts split into fragments; no instruction duplicated across modules.
  • Dead prompts removed; token reduction documented (before/after).
  • Each prompt has a name + version with an auditable, diffable history.
  • Prompt changes can be reverted independently of surrounding code.
  • Per-prompt token profiling available.
  • A quality eval reports a delta on a prompt change.
  • Backward compat preserved via app/prompt.py re-exports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions