juppiter journal juppiter.com RSS

Retrieval and context

What Is RAG? Retrieval-Augmented Generation Explained for Investment Firms

What is retrieval augmented generation (RAG)? How it works, where basic RAG falls short on fund documents, and how hybrid retrieval and graphs help.

Dark title card reading What is RAG? with document chunks feeding a single highlighted passage card.

Retrieval-augmented generation, or RAG, is a way to make a language model answer from your own documents. Before the model writes an answer, the system searches a body of text for the passages most relevant to the question and hands them to the model along with the question. The model then answers from those passages, not only from what it learned in training. For an investment firm, that means an AI assistant can work from the firm's own notes, memos and filings.

RAG is one part of a larger discipline. Deciding what a model sees, and in what order, is context engineering, and RAG is the retrieval step inside it. This post explains RAG in plain terms, shows where a basic setup falls short on investment documents, and covers how hybrid retrieval and a knowledge graph improve it.

What is retrieval augmented generation (RAG) in simple terms?

AWS defines RAG as "the process of optimizing the output of a large language model, so it references an authoritative knowledge base outside of its training data sources before generating a response." The original paper by Lewis and colleagues framed it as pairing a model's built-in memory with an external, searchable one.

An analyst who answers from memory is working from training. One who first pulls the relevant notes and filings, then writes with them open, is doing what RAG does. AWS compares a model without retrieval to "an over-enthusiastic new employee who refuses to stay informed with current events but will always answer every question with absolute confidence."

How does RAG work?

A basic RAG system has two phases. The first happens ahead of time, and the second happens for every question.

Preparation. The documents are split into smaller pieces, usually called chunks. An embedding model turns each chunk into a list of numbers that reflects its meaning, and the chunks and their numbers are stored in a vector database. Anthropic describes the usual chunk size as no more than a few hundred tokens.

Each question. The question is turned into numbers the same way. The system finds the stored chunks whose numbers are closest, adds them to the prompt, and the model writes an answer from them. AWS adds that the external data also has to be updated as documents change, so the stored representations do not go stale.

Diagram. Two panels. Preparation: split documents into chunks, embed each chunk, store them. Every question: embed the question, find the closest chunks, add them to the prompt, and the model answers with citations.

Because the answer is built from named passages, the output can carry citations, and AWS lists this among the benefits: users can look up the source documents.

RAG vs fine-tuning: which is better for a fund?

Fine-tuning means continuing to train a model on your own material. Barnett and colleagues, in a paper on engineering RAG systems, describe the two options and note that fine-tuning requires "managing or serving a fine-tuned LLM", while RAG relies on existing, extensible knowledge artifacts. They add that both options have pros and cons related to privacy and security of data, scalability, cost and skills. AWS describes RAG as a way to extend a model to an organization's internal knowledge base "without the need to retrain the model."

For a firm, the practical difference is how knowledge changes. Research notes, deal documents and manager letters change constantly. Retrieval reads the current set at question time, so a new document can be searched once it is indexed, without retraining anything. The two are not exclusive. Weaviate calls RAG "pretty much ubiquitous for most knowledge base search systems."

RAG for finance: what it looks like at different firms

Here are three illustrative scenarios. They are examples, not real cases.

A hedge fund. A portfolio manager asks what the research team has written about a company's pricing power. The material is spread across analyst notes, call summaries and model commentary. A RAG system retrieves the passages that discuss it, and the model summarizes them with links back to the notes.

A family office. The office asks which of its manager relationships have a particular reporting or liquidity provision. The answer is in side letters and manager correspondence written in different words by different people. RAG can surface the passages that mean the same thing even when the wording differs.

A private equity fund. A deal team asks what has been said about a target's customer concentration across the data room, the management presentation and prior memos. RAG pulls the relevant passages from each and puts them in front of the model together.

All three work when retrieval finds the right passages. The next section covers what happens when it does not.

Why RAG fails in production

Barnett and colleagues present seven failure points from three case studies. Their two main conclusions are that validation of a RAG system is only feasible during operation, and that its robustness evolves instead of being designed in at the start. Four of the seven failure points matter most for investment documents:

  • The answer is in the documents but ranked too low. The relevant passage exists, but does not rank highly enough to be returned. Only the top few results go forward.
  • The answer is retrieved but does not make it into the context. Many results come back and a consolidation step drops the one that mattered.
  • The model fails to extract the answer. The passage is in the context, but noise or contradicting information around it gets in the way.
  • Incomplete answers. The answer misses information that was in the context, which is likely when a question spans several documents.
Diagram. Four numbered failure points: ranked too low, dropped before the context, model fails to extract it, and incomplete answer, each with a one-line explanation.

Anthropic names another source of failure that fits finance well. Splitting documents into chunks can remove context. A chunk reading "the company's revenue grew by 3% over the previous quarter" does not say which company or which quarter, which makes it hard to retrieve and hard to use correctly.

Entity names add a further problem. A search by meaning finds passages that sound like the question. It does not know that a ticker, a trade name and a former name are one company. In a fund's research archive, the same company can appear under all three.

RAG also does not remove hallucination. Retrieval gives the model better material to work from, but the model can still misread it, blend two passages or answer beyond what they say. Claims that RAG avoids or eliminates hallucination should be tested rather than taken on trust. A retrieval step lowers the risk and does not close it.

Finance questions are a hard case for the same reason. They often turn on one company, one period and one figure, so a passage that is close but not exact can produce a confident wrong answer. Read this as a reason to test retrieval quality on your own documents, not as a ranking of products.

Hybrid retrieval and reranking: fixing the "wrong passages" problem

Basic RAG relies on one kind of search, by meaning. Exact identifiers can slip past it. Anthropic gives the example of a query for "Error code TS-999", where an embedding model might find content about error codes in general but miss the exact match, while a keyword method such as BM25 finds it. In a fund's documents, think of a deal code name or a document reference.

Hybrid retrieval runs both kinds of search and fuses the results. In Anthropic's own tests, combining embeddings with BM25 beat embeddings alone, and adding a reranking step beat no reranking. A reranker scores each candidate passage against the question, so the best evidence goes first. That matters because models use their input unevenly: Liu and colleagues found that performance often drops when relevant information sits in the middle of a long context. The full explanation is in Hybrid Search vs Semantic Search vs Keyword Search.

GraphRAG and knowledge graphs: fixing the "disconnected facts" problem

Basic RAG treats each chunk as independent. Weaviate puts the limit this way: the approach "doesn't represent any relationships between data points beyond the proximity of their meaning in vector space." Questions that join facts, such as which funds a manager runs and what each one holds, depend on those relationships.

GraphRAG adds a knowledge graph. Microsoft researchers describe a method that uses a language model to build an entity knowledge graph from the documents and summarize groups of closely related entities. For a class of global questions over a dataset in the million-token range, they report improvements over a conventional RAG baseline in the comprehensiveness and diversity of answers. Weaviate lists the costs: summaries that need periodic reindexing as data changes, substantial token costs in the indexing pipeline, and trouble with entities that have thousands of connections. A graph is not free.

A graph built on resolved entities also helps with names. Knowledge Graph vs Vector Database for AI covers when a firm needs one, the other or both.

Is RAG dead?

The autocomplete suggestions include "is rag dead" and "rag is dead context engineering." RAG is better seen as one component of a larger practice. Andrej Karpathy's list of what fills a model's context window includes "RAG" next to task descriptions, examples, tools, state and history. Anthropic observes that many AI applications use embedding-based retrieval before the model runs, and that teams increasingly add "just in time" retrieval as models take on more agentic work. Retrieval stays. The question is how well it is engineered.

Why a knowledge engine fits RAG over firm documents

juppiter is a knowledge engine that securely organizes your firm data for fast and efficient access for your AI workflows. Per its Features page, each part answers one of the problems above.

  • Names that vary. juppiter resolves mentions during ingestion: "different references to the same company land on one entity, and the same is true of a person, a brand, a commodity or a theme."
  • Disconnected facts. Extracted entities are written into an ontology and a knowledge graph of "what your firm knows and how it fits together."
  • Wrong passages and weak ranking. Retrieval is hybrid. An ontology-based lexical search over a relevant subgraph runs with a semantic search over embeddings, and juppiter "pools and reranks the results and returns them as context."
  • Lost context inside a document. Sources are read in segments, "so later stages can extract meaning and entities from the parts of a document, not only from the file as a whole."
  • Scattered files. Documents, embeddings and the knowledge graph sit together, so analysts and AI workflows work "from that same organized body of knowledge, instead of assembling context by hand from scattered files."
  • Control over inputs and setup. Your team chooses what goes in, including which folders to leave out before the first sync, and forward-deployed engineers work with your team through onboarding and implementation.

None of this removes the need to test. It does give the firm a retrieval layer built around entities and connections, not around chunks alone.

How to test RAG on your own questions

Barnett and colleagues found that a RAG system can only really be validated in operation, so test with your own material. Collect twenty questions your analysts, associates or principals actually ask, including exact-term questions, meaning questions and questions that join facts across documents. For each, check what was retrieved, in what order, and whether the right passage was among them. Fix retrieval before changing the prompt.

Before connecting any system to firm data, also ask how it handles that data. The questions are in AI Vendor Due Diligence Questionnaire: What to Ask Before Connecting Firm Data. For how these pieces come together across a fund, see AI for Hedge Funds.

Request a demo

juppiter is a knowledge engine that securely organizes your firm data for fast and efficient access for your AI workflows.

Tell us about your firm, the sources your team relies on and the questions that are hardest to answer today, and we'll build the walkthrough around them.