DataCareerHub
Explore learning
← Applied AIFree companion · 50 minute suggested activity

1. Design an evidence-first AI workflow

Applied AI · Separate retrieval, extraction, validation and final factual review.

Learn → Try → ExplainReviewed 2026-10-15
01

Objective & prerequisites

Separate retrieval, extraction, validation and final factual review. Prerequisites: Python functions, JSON, lists and the existing API/testing foundations. Extract the full kit and open a terminal in applied-ai-kit. The core lab uses Python 3.10+ with no third-party dependencies or network. Actual new-text semantic inference is a separate optional local setup, tested on Python 3.12/macOS arm64. All CedarLab policies, invoices and review cases are fictional teaching material; they are not DataCareerHub service terms. No payment, registration, live chatbot or visitor-data collection is activated. These free companions do not change course progress or protected access.

python3 lab.py
python3 -m unittest discover -s tests -v
02

Understand the concept

A useful AI workflow starts with a task and an evidence contract. Retrieval finds candidate passages; it does not decide the answer is true. Extraction proposes fields from text; valid structure does not prove those values match the source. Factual-support review compares each atomic claim with eligible evidence, considering negation, dates, numbers and scope. Keep these boundaries visible in both code and reports. An unsupported question should produce an abstention or a request for evidence rather than a fluent guess. Source documents are untrusted data, even when retrieved by a model. This kit deliberately avoids a generative answer service so you can inspect each boundary before adding one.

03

Worked example

The corpus has eight short passages with IDs and versions: seven current and one retired draft. Queries include six answerable paraphrases and an unsupported breakfast question. A real pretrained encoder produced the supplied vectors; lab.py replays those vectors for the named fixture queries. A separate rule-based extractor handles narrow invoice text. Eight hand-authored claim cases are reviewed against sources. These are separate measured activities, not an end-to-end chatbot accuracy score.

from lab import load,validate_corpus
docs=validate_corpus(load("corpus.json"))
assert len(docs)==8
assert sum(d["status"]=="current" for d in docs)==7
04

Try it yourself

Draw input → eligible sources → retrieval → proposed claim/fields → structure check → evidence review → answer or abstain. Mark which steps are executed models, pure functions, human decisions and future integrations. Write a failure example at three boundaries. Write your prediction, inspect the source and record actual results. Keep a copy of the original fixtures before making changes.

Worked solution

A retired source should be excluded before ranking; a repeated JSON key should fail parsing; a real quote accompanying a wrong numerical claim should still fail factual review. No generative model is invoked by the core command. Keep retrieval rankings and review labels as separate outputs so one cannot disguise a failure in the other.

06

Knowledge check

If retrieval finds a plausible passage, has the full answer been verified?

Check and explain

No. You still need eligible evidence, a supported interpretation and appropriate abstention. Retrieval is candidate selection.

08

Evidence, mistakes & handover

Record the executed mode: actual local encoder, saved-vector replay, deterministic extraction or human factual review. They establish different things. Keep model/version, source hashes, commands, expected outcomes, failures and limitations with your work. Never turn a schema pass, cosine score or quotation into a claim of proven truth. The download contains a worksheet, independent controls, worked solutions, a factual-review rubric, privacy/cost contract and mini-project checklist. Credit the supplied starting point and describe your own contribution.

09

Authoritative reference

Read the official reference ↗

— official source for the underlying mechanism. Teaching prose and CedarLab cases are original. Model/runtime compatibility, licensing and operating limits require review for any later deployment; this course does not activate a production AI service.

Make the reasoning yours.

Try the activity before reading its reference. Keep your sources, commands and assumptions with your work. Companion activities are unsaved self-practice and do not award a certificate or change lesson progress.

Resume guidance and examples are for learning and preparation only. They do not guarantee interviews, a job offer or employment.

Public registration, payments and new paid enrolment remain disabled. These free resources do not grant access to protected course modules.

Learner dashboard ↗ · Ask a question ↗