liveBook · Manning

Retrieval-augmented generation

As explained in Financial AI in Practice

A method that retrieves relevant external information and supplies it to a generative model when producing an output.

A market-news analyst needs to assess a policy announcement posted minutes ago. A large language model (LLM) may reason about the announcement, but its training knowledge cannot include the new post. Retrieval-augmented generation (RAG) fetches relevant information from an external source and supplies it alongside the query, grounding the response in current, verifiable context rather than treating the model as a fact database. section 3.3.2 section 11.0

A practical RAG workflow has two connected paths: prepare information for search, then use it at query time.

  • Ingest new or updated documents; parse and standardize them, remove duplicates where feeds overlap, and retain source and publication-date metadata. section 3.3.2 section 11.5
  • Choose document boundaries that preserve useful context, embed the resulting text, and index its vectors for similarity search. Chunking needs judgment: very small pieces may match precisely while losing surrounding context. Short news snippets can instead remain intact. section 3.3.2 section 11.5
  • Embed the query, retrieve relevant snippets, and place them in a structured prompt for the LLM. For market analysis, request machine-readable JSON signals that retain evidence and reasoning. section 11.1.4 section 11.5
Figure 11.1 The qualitative engine architecture: end-to-end pipeline from raw news to structured signals. Raw text from APIs and RSS feeds enters the RAG feature engineering pipeline (data cleaning, embedding, vector database storage). When a user query arrives, the system retrieves relevant documents and constructs a structured prompt for the LLM, which outputs quantifiable signals (sentiment, supply risk, policy tone) in JSON format.
figure

The end-to-end diagram follows news from APIs and RSS feeds through cleaning, embeddings, retrieval, prompting, and structured signals. section 11.1.4

News signals beside market data

A qualitative engine can retrieve news about central-bank policy or supply disruption and turn the supported narrative into policy-tone, supply-risk, or novelty features. Those features complement price- and volume-based signals; they are research inputs, not an automated trading decision. section 11.0 section 11.5

Retrieval does not guarantee truth. Outdated documents, poor indexing, or irrelevant matches can still produce wrong answers. In finance, keep ingestion current and retrieval auditable; fraud-investigation corpora also call for personal-information scrubbing, controlled access, and filtering by attributes such as date or source. Evals, guardrails, and human oversight reduce risk without removing it. section 3.1.3 section 7.4.3 section 11.5

How Financial AI in Practice covers it

How deep it goes
Traces ingestion through embeddings, retrieval, and structured output; treats the supplied response code as conceptual rather than production-ready.
Examples
Uses a current-post digest, multisource financial news, and fraud case files to show retrieval contexts.
What it assumes
Assumes familiarity with LLMs and financial data workflows while defining RAG and walking through its retrieval pipeline.
What you can do after
Build it from scratch as a news-to-JSON retrieval pipeline, while checking source freshness, evidence, and governance controls.
How it connects
Links chunking, text embeddings, vector databases, prompt engineering, qualitative signals, and human oversight.

Also explained in

Compare how 32 books explain retrieval-augmented generation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Financial AI in Practice. The section links point to the parts of the book it draws on.