Retrieval-Augmented Generation

Retrieval-augmented generation (RAG) grounds a language model’s output by retrieving relevant external knowledge and supplying it as context at inference time.

What is retrieval-augmented generation?

Retrieval-augmented generation (RAG) is a technique for improving the output of a large language model (LLM) by retrieving relevant information from an external knowledge source and supplying it to the model as additional context at the moment a response is generated. Instead of relying solely on the knowledge baked into its weights during training, the model is given fresh, specific, and verifiable material to work from.

RAG addresses two of the most serious limitations of generative AI: the tendency to “hallucinate” plausible-sounding but incorrect statements, and the fact that a model’s training data is frozen at a point in time and cannot include private or recently-changed information.

How RAG works

A RAG system generally has two parts working together:

  • A retriever locates the most relevant pieces of information for a given query. This commonly relies on vectors — text and queries are converted into embeddings, and the retriever finds passages whose embeddings are closest to the query. Retrieval can also draw on structured sources such as knowledge graphs.
  • A generator — the language model itself — takes the original query together with the retrieved context and produces a grounded, fluent answer.

A typical flow looks like this: the user’s question is embedded and used to search a knowledge base; the top results are inserted into the model’s prompt; and the model composes an answer that draws directly on that supplied material, ideally with citations back to the source.

GraphRAG and structured retrieval

Classic RAG retrieves unstructured chunks of text, which can miss the relationships between facts. GraphRAG instead retrieves from a knowledge graph, so the model receives not just isolated passages but the connected entities and links around a topic. This structure helps the model answer multi-step questions, respect constraints, and reason over how pieces of information relate — and it pairs naturally with metadata that records the provenance of each retrieved fact.

RAG in HASH

A high-quality, well-structured knowledge source is what makes RAG reliable, and that is precisely what HASH is built to provide. By maintaining a typed, bitemporal graph of an organization’s entities — complete with provenance and confidence — HASH can serve as the grounded retrieval layer for AI systems, ensuring that generated answers are anchored to information that is current, traceable, and trusted rather than to statistical guesswork.

Create a free account

Sign up to try HASH out for yourself, and see what all the fuss is about

By signing up you agree to our terms and conditions and privacy policy