Retrieval-Augmented Generation (RAG)
Retrieval-Augmented Generation hands a language model passages pulled from your own data, so it answers from your content. On IBM i, retrieval is the hard half.
Retrieval-augmented generation, almost always shortened to RAG, retrieves the passages most relevant to a question from your own data and includes them in the prompt sent to a large language model, so the answer is grounded in current, specific content rather than only in what the model absorbed during training. It is the standard design for getting an AI system to answer questions about your documents, your runbooks and your history.
On IBM i the generation half is straightforward and the retrieval half is where the work is. Retrieval needs a vector store, and Db2 for i has none as of September 2026, so the index lives outside the database. IBM's stated direction is OpenSearch running on Power as the hybrid vector, text and structured search layer, with Db2 for i staying the system of record. watsonx.ai supplies the embedding models and the text embeddings API that create the vectors, and IBM's documentation is explicit that storing them is your job, in a database you provide. The Bob Premium Package for i lists RAG workflows among its IBM i skills, but IBM has not published where those workflows keep embeddings.
One thing worth deciding early: exact, structured questions do not need RAG at all. Route those to Db2 for i through the IBM i MCP Server and save retrieval for questions no single row can answer.
Related Terms
Vector Store
A vector store holds embeddings and finds the ones closest to a query. It is the retrieval half of RAG, and Db2 for i has no vector store as of 2026.
OpenSearch
OpenSearch is the open-source hybrid search engine IBM has positioned as the vector, text and structured search layer for RAG on Power, since Db2 for i has none.
Db2 for i
The relational database management system built into every IBM i operating system, tightly integrated with IBM i rather than a separately installed database product.
IBM i MCP Server
An open-source, IBM-published server implementing the Model Context Protocol (MCP), letting AI agents and LLMs query Db2 for i data and take defined actions on IBM i using natural language. In beta since October 2025.
Large Language Model (LLM)
A machine learning model trained on large volumes of text, used as the underlying technology behind generative AI tools including IBM Bob and general-purpose assistants like ChatGPT and Claude.
Foundation Model
A large, general-purpose AI model trained on broad data and then adapted, through prompting, tuning, or fine-tuning, to specific tasks such as RPG code generation.