Skip to content

AIMI 106 · Module 1

RAG & Knowledge Architecture

Core question: before an AI assistant answers questions about corporate disclosures, what must the knowledge behind it look like so every answer can be traced and checked?

Start Section 1
0 / 6 completed
Sync my progressJoin a session to keep progress across devices and share it with your instructor

Info

After you join, your completed lesson numbers are sent to your instructor together with your learner code, so they can see your progress. Use the codes your instructor gave you or the email you sign in with, and do not enter your name, company secrets or other personal data. Progress is kept with the rest of that session's data.

Learning objectives

  • Frame a media knowledge assistant as a trust problem with users, questions and the cost of a wrong answer
  • Compare LLM-only answering, RAG and multi-step agentic retrieval, and say when each fits
  • Design document sources with source, date, version and page/section identifiers
  • Choose a chunking approach and the metadata each chunk must carry
  • Explain embeddings, keyword search and hybrid search, and their typical failure modes
  • Produce a source and chunking design for two simulated disclosure reports

A Trust Problem, Not a Tool Choice

8 min

A Trust Problem, Not a Tool Choice

Learning objective: frame a financial-media knowledge assistant as a trust problem. Before choosing any tool, state who asks which questions, what a wrong answer would cost, and who checks the answer before it is used. This course (106-CLO1 to 106-CLO4) builds a small RAG prototype over two simulated corporate disclosure reports and evaluates whether it can be trusted.

Human → AI → Human
  1. Human defines the questions, the allowed documents and what counts as evidence
  2. AI retrieves passages and drafts an answer with citations
  3. Human checks the citations, decides whether to use the answer and remains accountable

Fluent but untrusted

  • Answers sound confident whatever the evidence
  • No way to see which document a claim came from
  • Missing information is filled in with plausible text

Trusted knowledge system

  • Every claim points to a document and page or section
  • A reader can open the source and check it
  • When evidence is missing, the system says so instead of guessing

Warning

Simulated-scenario notice: the disclosure reports, the outlet Formosa Finance Daily (simulated) and every figure in this course are teaching material. They do not describe any real company, and nothing in this course is investment advice.
Check yourself

A research desk wants an AI assistant that answers questions about listed companies' annual reports. What should be defined first?

A research desk wants an AI assistant that answers questions about listed companies' annual reports. What should be defined first?

Key takeaway: A knowledge assistant is only as useful as it is checkable: define users, evidence and the cost of error before any tool.

LLM-only, RAG and Agentic Retrieval

10 min

LLM-only, RAG and Agentic Retrieval

Learning objective: compare three ways of answering a question about documents and say when each fits (106-CLO1).

Three architectures compared (qualitative)
ArchitectureHow it answersStrengthMain risk
LLM-onlyFrom what the model learned in training, with no document lookupFast, good for general explanationsNo access to your documents; may state outdated or invented facts with no source
RAG (retrieval-augmented generation)Retrieves passages from your documents once, then answers from themAnswers can cite specific passages; documents can be updated without retrainingIf retrieval misses the right passage, the answer is wrong or unsupported
Agentic retrievalPlans several retrieval steps, checks what it found, retrieves again, then answersHandles comparisons across documents and multi-part questionsMore steps mean more cost, more places to fail and more need for logs and limits
  • Use LLM-only for general concepts where no specific document is the source of truth
  • Use RAG when the answer must come from a known document set and be cited
  • Use agentic retrieval only when a question genuinely needs several lookups, for example comparing two reports
  • Whichever you choose, a human still reviews answers that will be published or used for decisions
Check yourself

A reporter asks: "How do the supply-chain risk statements in Report A and Report B differ?" Which architecture fits best?

A reporter asks: "How do the supply-chain risk statements in Report A and Report B differ?" Which architecture fits best?

Key takeaway: Pick the simplest architecture that can cite the right evidence; add agentic steps only when the question needs them.

Document and Source Design

12 min

Document and Source Design: Dates, Versions and Page/Section Identifiers

Learning objective: design the document set so every retrieved passage can be traced back to one lawful source, one version and one location (106-CLO2). A citation is only as good as the identifiers you kept when loading the documents.

What to record for every document before loading it
FieldExample (format only)Why it matters
Document idreport-aA stable id that never changes, used in every citation
Source and rightsPublic disclosure, use permitted for teachingReadable is not automatically reusable; record why you may use it
Publication dateThe date printed on the documentAnswers about "the latest" depend on dates
VersionOriginal or amendedAn amended report can change a figure or a risk statement
Page / section idPage number plus section heading or numberLets a reader open the exact place and check the claim
Languagezh-TW or enAffects keyword search and how questions should be phrased

Warning

Critical fail in this course: inventing a document, a page number or a section that does not exist. If a document has no page numbers, cite the section heading you actually loaded; never make one up.
Check yourself

Report A was amended after first publication, and both versions are in your folder. What should your source design do?

Report A was amended after first publication, and both versions are in your folder. What should your source design do?

Key takeaway: No identifier, no citation: record source, rights, date, version and page/section before loading anything.

Chunking and Metadata

12 min

Chunking and Metadata

Learning objective: choose how to split documents into retrievable chunks and which metadata each chunk must carry, so the right passage is found and can be cited.

Chunks too large

  • One chunk mixes several topics
  • Retrieval returns long text where the answer is buried
  • Citations point to a whole chapter rather than a checkable place

Chunks too small

  • A sentence loses its context (which company, which year, which risk)
  • A table row is separated from its header
  • The answer needs many fragments stitched together
  • Split by document structure first: sections, headings and numbered items, rather than by a fixed character count alone
  • Keep a small overlap or the section heading with each chunk so it still makes sense on its own
  • Keep tables whole, or repeat the header row in each table chunk
  • Attach metadata to every chunk: document id, version, date, page, section id and language
  • Write the chunking rule down so another person can reproduce it
Chunk record (format illustration, not taken from a real document)

doc_id: report-a | version: original | date: as printed on the report | page: the page you loaded | section: Risk Factors > Supply chain | text: the paragraph exactly as written in the source.

Check yourself

Your assistant retrieves the sentence "This risk increased compared with the prior year" but cannot say which company or which risk it refers to. What is the most likely cause?

Your assistant retrieves the sentence "This risk increased compared with the prior year" but cannot say which company or which risk it refers to. What is the most likely cause?

Key takeaway: Chunk along the document's own structure and give every chunk the metadata needed to cite it.

Exercise: Source & Chunking Design

8 min

Exercise: Source & Chunking Design

Learning objective: design the knowledge base for the lab. Formosa Finance Daily (simulated) wants an assistant that compares the risk statements in two simulated public disclosure reports, Report A and Report B, and always cites document and page or section.

  1. Register the sources
    For Report A and Report B, record document id, source and rights, date, version and how pages or sections are identified.
  2. Choose a chunking rule
    Decide how you split each report (by section, heading or item) and how you keep tables and headings intact.
  3. List the metadata
    List the metadata every chunk will carry and which of it you will filter on.
  4. Pick a search method
    Choose keyword, semantic or hybrid search and give one reason linked to the questions you expect.
  5. Note the data rules
    Write which tools you may upload the reports to, and confirm no restricted or personal data is involved.

Done

Completing this design counts as exercise 1 (aimi106-m1-source-design). It becomes the Document sources and Chunking and metadata fields of artifact 106-A1.

Key takeaway: Module summary: trusted answers start with traceable sources, structure-aware chunks, complete metadata and a search method matched to the questions.

What next?