Back
advanced

AI Agents & Autonomous Systems

Project: build a research assistant that can show its evidence

Create an evidence ledger, handle missing or conflicting sources, and evaluate a research workflow before adding more agents.

Lesson 32 of 67About 38 min with practice

Which workshops suit a beginner who can attend only after 6 pm? Build a research assistant that can justify every included option and preserve uncertainty when a record cannot settle the question.

Before you begin: You understand retrieval, bounded agent loops, and source-grounded answers.

Start with a local collection so failures are reproducible. Live web research can come later, with source dates and changing-page behavior added deliberately.

Create the evidence collection

Include a beginner workshop at 19:00, an advanced workshop at 19:00, a beginner workshop at 17:00, and a beginner workshop with no time. Add one outdated record that conflicts with a newer authoritative version.

Give each record a stable ID, version, source title, and relevant permissions. Decide what “after 6 pm” means for the exercise: strictly later than 18:00, with a stated timezone. Ambiguous time rules should not be hidden inside generated prose.

Keep claims linked to records

The system should produce candidate findings before writing an answer. Each finding needs a claim, supporting record IDs, and any unresolved uncertainty. A citation is useful only if the linked record supports that specific claim.

python
# Runnable: Python 3, standard library.
records = {
    'pottery-v2': {'level': 'beginner', 'hour': 19},
    'drawing-v1': {'level': 'beginner', 'hour': None},
    'robotics-v1': {'level': 'advanced', 'hour': 19},
}
eligible, unknown = [], []
for source_id, record in records.items():
    if record['level'] != 'beginner':
        continue
    if record['hour'] is None:
        unknown.append(source_id)
    elif record['hour'] > 18:
        eligible.append(source_id)
assert eligible == ['pottery-v2']
assert unknown == ['drawing-v1']
print({'eligible': eligible, 'time_unknown': unknown})

This deterministic baseline already solves the structured part of the task. A model may help interpret varied questions and explain the result, but it should not replace a reliable time filter with guesswork.

Test the boundary at exactly 18:00

The project defines “after 6 pm” as strictly later than 18:00. Add a beginner workshop at exactly 18:00. It should be excluded under that rule, while 18:01 should qualify if the rest of the record satisfies the request.

The local program uses integer hours, so it cannot distinguish 18:00 from 18:01. How should you extend it?

Match the representation to the question

Use minutes since midnight for this same-day fixture, or properly parsed timezone-aware dates and times for real events. Preserve date and timezone when comparing across days or regions. A coarse hour-only representation is enough for the original three records but not for every boundary case.

Add unknown time and conflicting revision cases beside the exact boundary. Your evidence ledger should explain why each item is included, excluded, or unresolved. An empty recommendation list is correct when no item is confirmed suitable; inventing a time to produce a fuller answer is not.

Add an evidence-aware workflow

Parse the user's constraints, retrieve permitted records, resolve versions using an explicit source rule, evaluate eligibility, and draft a cited answer. Add a final check that each recommended workshop satisfies every required condition.

If using separate agents, keep the retriever's output as source records and the writer's input as verified findings. The writer must not silently turn “time unknown” into “probably suitable.” A verifier should inspect actual source fields rather than merely asking whether the answer sounds reasonable.

For free-text sources, record short supporting passages with locations. Preserve the full source for inspection. Search snippets are leads, not always enough evidence for a final claim. When a source is unavailable, record the gap instead of fabricating a citation.

Test the uncomfortable cases

Create held-out questions involving missing times, conflicting versions, no eligible workshops, and documents the current user cannot access. Include a document containing an instruction to ignore the user's constraints; it should remain untrusted source text.

Measure correct recommendations, unsupported claims, missing qualifying options, unnecessary tool calls, and correct handling of unknowns. For live sources, also record retrieval date and distinguish publication date from event date.

Completion exercise: provide a cited answer and a compact evidence ledger for five test questions. A successful answer can say that no workshop is confirmed suitable. The project fails if it invents a time to avoid an empty result.

The next lesson examines how such a workflow can exchange tasks with an independently operated agent.

Sources

ReAct motivates using observations between decisions. The A2A core specification describes task and artifact exchange when the workflow crosses agent-service boundaries.

Continue: A2A and Multi-Agent Protocols.

Practice for this lesson

Keep every claim linked to a record

Build an evidence collection and test the uncomfortable boundary cases.

About 18 min80 points3 checks and one written task
Loading your lesson progress...