Nasdanika RAG is a retrieval augmented generation framework in Java. The goal of the framework is to provide Java developers means to assemble RAG designs which match their tasks at hand.
The framework takes Capability, Architecture/Solution building blocks approach. Architecture building blocks provide one or more capability, solution building blocks implement one or more architecture building blocks.
One of definitions of software development is “the process of incremental binding of decisions to make them executable”. This framework follows this paradigm - it defines high-level generic abstractions then progressively binds generic parameters and then concrete implementations.
The diagram above depicts the architecture building blocks. The below diagram shows how the building blocks interact during loading and retrieval/generation phases.
For each architecture building block there may be multiple solution building blocks. A combination of compatible solution building blocks is called a “design” or “embodiment”. Solution building blocks for the same architecture building block may be chained and composed to produce new solution building blocks.
The following sections provide brief overviews of the architecture building blocks. Click on the diagram elements or use the left navigation or links to navigate to the blocks’ pages with more detailed information and a list of solution building blocks.
Sources of data. There might be multiple solution building blocks with two primary design dimensions:
Data items can be converted from one format to another. As such data sources can be chained and composed.
Reads data items from data sources and adds them to the repository
Creates store items from data items. For example, breaks down a document into sections and paragraphs. Computes embeddings (keys) and some item identifier/locator and adds items the store to make them discoverable by the retriever.
Takes a data item of a fragment of it (say a paragraph from a text document) and computes a key. The key is something that identifies the data item. Some key types may support similarity computation.
Examples of keys:
Contains associations between item keys (e.g. vector embeddings) and item identifiers. Data items can be stored by value or by reference. The store can be indexed.
Computes query key and retrieves matching items from the store sorted by similarity.
Takes a request, passes to the query engine. Then uses the request and the query results to formulate a request to the generator. For example, if the generator is an LLM, it would create prompts or chains of thought from the query results. Then it passes the request, the query results, and the response from the generator to the responder.
Creates a summary response from a request and query results.
This component might not be present in some embodiments. E.g. in the case of Semantic Search the Responder will generate a response.
Takes the request, query results, generator response and creates a response for the user.
A user (client) of a RAG solution - a human or a system.