A Complete Persona Pattern Example Flashcards

(25 cards)

1
Q

What two new expert tasks are added to the invoice agent?

A

Categorizing expenditures into predefined categories and checking invoices against purchasing rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why use expert tools instead of hardcoding rules?

A

It keeps the architecture clean, adaptable, and avoids embedding complex rule logic in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the categorize_expenditure tool take as input?

A

A one-sentence description of the expenditure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does categorize_expenditure return?

A

A single category name chosen from a fixed list of 20 categories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is a fixed category list useful?

A

It constrains outputs so the agent returns consistent, valid classifications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What persona is used for expenditure categorization?

A

A senior financial analyst specializing in corporate spending categorization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the purchasing rules expert?

A

To validate whether invoice data complies with company purchasing policies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why load purchasing rules from disk instead of hardcoding?

A

Policies can be updated without changing code, and the human-readable rules become the logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where are purchasing rules stored in the example?

A

config/purchasing_rules.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens if the purchasing rules file is missing?

A

The tool defaults to “assume all invoices are compliant” (or another fallback rule).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does check_purchasing_rules return in the basic version?

A

A compliance result (true/false) and a brief explanation of issues.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is free-text compliance output sometimes insufficient?

A

Other systems need predictable structure for logging, workflows, and reporting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does prompt_llm_for_json add to the compliance tool?

A

Enforces a structured JSON output that conforms to a schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What fields are required in the compliance JSON schema?

A

compliant (boolean) and issues (string).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is schema-enforced output important for downstream systems?

A

It makes results machine-readable and easy to store, trigger workflows, or aggregate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What example rule triggers noncompliance in the case study?

A

Purchases over $5,000 require pre-approval.

17
Q

In the example invoice, why is the purchase noncompliant?

A

Total exceeds $5,000 and lacks required pre-approval.

18
Q

What additional policy example is given for consulting services?

A

Consulting fees over $10,000 require an SOW (Statement of Work).

19
Q

What does the invoice agent’s updated workflow include after extraction?

A

Summarize expenditure, categorize it, validate against policies, store results, and report summary.

20
Q

What is the one-sentence summary used for in the workflow?

A

As the input to the categorization expert tool.

21
Q

What is the role of function calling in this updated agent?

A

It lets the agent invoke tools reliably using structured tool calls rather than parsed text.

22
Q

Why does this example demonstrate “personas as tools”?

A

Categorization and compliance expertise are encapsulated in separate tools instead of the core agent prompt.

23
Q

What is the advantage of separating compliance into a tool?

A

You can update rules, prompts, and schema without rewriting the agent’s core goals.

24
Q

What is the risk mentioned even with structured extraction?

A

The LLM may still hallucinate, so production systems may need additional safeguards.

25
What is the key architectural theme of this case study?
Modular expertise: keep core orchestration clean and push domain reasoning into specialized expert tools.