Objective
A Simple RAG (Retrieval-Augmented Generation) system provides intelligent information retrieval and answer generation by combining your own knowledge base with large language models. This architecture enables applications to provide accurate, contextual responses based on your specific documents and data while maintaining the natural language capabilities of modern LLMs.Use Case
Simple RAG is ideal for applications that need:- Document-Based Q&A: Answer questions based on company documents, manuals, or knowledge repositories.
- Internal Knowledge Search: Help employees find information from internal wikis, policies, or procedures.
- Customer Support: Provide accurate answers based on product documentation and support materials.
- Domain-Specific Information: Reduce hallucinations by grounding responses in verified company data.
- Contextual Responses: Generate answers that reference specific sources and maintain accuracy.
Prerequisite
Before configuring a Simple RAG, ensure you have:- Orq.ai Account: Active workspace in the Orq.ai Studio.
- API Access: Valid API key from Workspace Settings > API Keys.
- Model Access: At least one text generation model enabled in the Model Garden, such as gpt-4,claude-3-sonnet, orgpt-3.5-turbo.
- Embedding Model: At least one embedding model enabled for knowledge base functionality, such as text-embedding-ada-002ortext-embedding-3-small.
- Source Documents: PDF, TXT, DOCX, CSV, or XML files containing your knowledge base content (max 10MB per file).
Creating a Knowledge Base
First, create a knowledge base to store your documents. Head to the Orq.ai Studio:- Choose a Project and Folder and select the +button.
- Choose Knowledge Base.
- Enter a unique Key (e.g., companyDocs) and Name.
- Select an Embedding Model from your enabled models.

You can change embedding model later on.
Adding Source Documents
After creating the knowledge base:- Click Add Data Source to upload your documents.
- Select files from your computer (TXT, PDF, DOCX, CSV, XLS formats supported).
- Configure chunking settings for optimal retrieval performance (to learn more, see Chunking Strategy)
- Wait for the documents to be processed and indexed.
Configuring a RAG Deployment
To create a Deployment with RAG capabilities:- Choose a Project and Folder and select the +button.
- Choose Deployment.
- Enter name simpleRAG.
- Choose a primary Model.
YAML
Adding Knowledge Base to Prompt
- Open the Knowledge Base tab in the Configuration screen.
- Select Add a Knowledge Base.
- Choose your knowledge base key (companyDocs).
- Set the type to Last User Message for automatic query-based retrieval.
- Click Save.

When the knowledge base is correctly loaded, it will show up in blue.
Learn more about knowledge base configuration in Knowledge Base, and prompt configuration in Using Knowledge Bases in Deployments.
When ready with your Deployment choose Deploy, learn more about Deployment Versioning.
Integrating with the SDK
Choose your preferred programming language and install the corresponding SDK:Viewing Logs and Retrievals
Going back to the Deployment page, you can view the calls made through your RAG application. You can view details for a single log by clicking on a log line. This opens a panel containing all the details for the log, including:- The user’s question and generated response
- Retrieved document chunks and their relevance scores
- Source attribution and metadata
- Performance metrics and response times

Within the logs you'll be able to see the source retrievals and their score.
- Retrieval Quality: Review which documents are being retrieved for different queries
- Answer Accuracy: Monitor response quality and source attribution
- Query Patterns: Identify common questions and knowledge gaps
- Response Times: Track performance of knowledge base searches and generation
To learn more about logs and retrievals see Logs and Knowledge Base Retrievals.
You’ve completed the setup for a Simple RAG system. Explore other Common Architecture patterns to see more advanced RAG implementations.