Best practices for cognitive agent prompts.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
You are a {{skill}} specialist agent in a multi-agent cognitive workflow.
## Your Role
{{description}}
## Constraints
- Your output MUST conform to the provided JSON schema
- You have a maximum of {{maxOutputTokens}} tokens
- Only use the tools you are authorized for: {{tools}}
## Output Schema
{{outputSchema}}
## Current Context
{{contextSnapshot}}
## Your Task
Analyze the provided context and produce a structured output matching your schema.
1
2
3
4
5
❌ Don't: "Analyze the document and share your findings."
✅ Do: "Analyze the document and return a JSON object with:
- findings: array of strings (max 10)
- confidence: number between 0 and 1"
1
2
3
4
5
Your output MUST match this schema:
{
"findings": ["string"],
"confidence": 0.95
}
1
2
3
- Maximum 5 findings
- Each finding should be one sentence
- Confidence must be between 0 and 1
1
2
3
4
You are a **Semantic Mapper** agent responsible for:
- Binding natural language terms to ConceptIDs
- Using the Knowledge Graph for lookups
- Providing confidence scores for each mapping
1
2
3
4
## Current Context Snapshot
Query: "{{query}}"
Existing Bindings: {{bindings}}
Round: {{round}} of {{maxRounds}}
1
2
3
4
5
6
7
8
9
## Required Output Format
Return a JSON object with this exact structure:
{
"mappings": [
{ "term": "customer", "conceptId": "sea:customer:001", "confidence": 0.95 }
]
}
DO NOT include any text before or after the JSON.
1
2
3
4
5
6
7
8
9
You have access to these tools:
- read-kgs: Query the Knowledge Graph
- query-sbvr: Evaluate business rules
To use a tool, output:
{
"tool": "read-kgs",
"input": { "sparql": "SELECT * WHERE { ?s ?p ?o }" }
}
1
2
3
4
5
6
Tool results will be provided as:
[TOOL_RESULT: read-kgs]
{ "nodes": [...] }
[/TOOL_RESULT]
Use these results to inform your final output.
1
2
3
IMPORTANT: Your output MUST be valid JSON matching the schema.
If you cannot provide a valid output, return:
{ "error": "reason", "partial": {...} }
1
2
3
4
5
Score your confidence as:
- 0.9-1.0: High confidence, clear evidence
- 0.7-0.9: Moderate confidence, some ambiguity
- 0.5-0.7: Low confidence, significant uncertainty
- Below 0.5: Insufficient evidence, consider abstaining
1
2
3
4
5
6
7
8
# Too vague
"Analyze this document."
# No structure
"Give me your thoughts."
# No bounds
"List all relevant findings."
1
2
3
4
5
6
7
8
# Specific
"Extract the top 5 key financial metrics from this quarterly report."
# Structured
"Return a JSON object with 'metrics' array and 'summary' string."
# Bounded
"Maximum 5 metrics, each with name and value."
1
2
3
4
5
6
7
8
9
10
# Test prompt with specific input
just cognitive-test-prompt \
--agent semantic-mapper \
--input "Map these terms: customer, order, payment"
# Compare outputs across prompt versions
just cognitive-compare-prompts \
--v1 prompts/v1.md \
--v2 prompts/v2.md \
--test-cases tests/mapper-cases.json