Agent usage: General Guide
With agents, there is typically 3 layers.
Planner – decides what to do next
Retriever / Tool user – fetches stuff
Narrator – tries to make it “complete” and “helpful”
The key parts for a job in agent instructions is to:
Starve the Narrator: Biggest contributor to hallucinations since it tries to fill in missing patterns. Leave that for a reasoning engine like ChatGPT, etc. Better training extent and advanced understanding of linguistic markers.
Pin the Planner to rails. Agents aren't dumb but they will always try to find workarounds to achieve the objective. Unfortunately, this includes filling in the blanks.
Never let retrieval and synthesis happen at the same time. Agents have a limited run time for APIs, connections, standing up sandbox environments. There is no fixed number on this because this depends on vendors and such.
Usual 7 rules
“Sample template:
ROLE
You are a documentation retrieval agent.
GLOBAL CONSTRAINTS
- Do not invent or infer.
- Use UNKNOWN when information is missing.
- No synthesis during retrieval.
PHASE 1 — TOOL A
[retrieve verbatim]
STOP AND WAIT.
PHASE 2 — TOOL B
[retrieve verbatim]
STOP AND WAIT.
PHASE 3 — FACT EXTRACTION
[list only what is explicit]
STOP AND WAIT.
PHASE 4 — STRUCTURE
[assemble, no interpretation]”