For the complete documentation index, see llms.txt. This page is also available as Markdown.

How To : Embed RAG into your App

How to embed Gen AI into an existing application using the Dataworkz RAG API

Introduction

Dataworkz provides RAG as a Service, enabling you to build GenAI applications that use proprietary data with either public LLM APIs or privately hosted open-source foundation models.

With the Dataworkz RAG builder, you can assemble your AI stack — vector database, embedding model, and LLM — and connect it to business data sources including SaaS applications and databases.

Dataworkz RAG Builder exposes a REST API for integrating Q&A capabilities into web applications. The API lets users ask free-form natural language questions against your data and receive high-quality, human-readable responses along with the authoritative sources those responses came from.

Dataworkz has published a sample app that demonstrates API integration.

Pre-requisites

  • A Dataworkz RAG Q&A system already configured in your account. Use these steps to build a Q&A system.

  • The host name of the Dataworkz RAG service you are targeting (e.g. https://genai.dataworkz.com).

  • An API Key for the target Dataworkz system.

  • All Angular CLI dependencies up to date on your machine.

Concepts and Terminology

Q&A System — a named instance containing its own set of documents, data transformation settings, parameters, and configuration. Multiple Q&A systems can exist in a single Dataworkz account, allowing you to power different applications, isolate data by department, or maintain separate versions. When making a query, you specify which Q&A system to target.

LLMProvider — a configured Large Language Model (LLM) instance within Dataworkz. Dataworkz supports multiple providers, including OpenAI, Google Vertex AI, and privately hosted open-source LLMs.

Questions — queries submitted by users to a Q&A system. Dataworkz uses RAG to retrieve relevant content from the associated data corpus and generate an answer.

Monitoring — Dataworkz RAG Builder tracks system performance, provides quality scores, validates LLM responses to prevent hallucinations, and allows users to submit feedback on answers.

Building a RAG Application

Authentication

All API calls require an API key passed in the Authorization header. Use the format SSWS <api-token>.

Listing Q&A Systems

Use the systems listing API to retrieve all Q&A systems in an account. Use the systemId returned by this API to identify the system for subsequent operations.

Getting a List of LLMs

Use the LLMs for a system API to retrieve all LLMs configured for a given system. You can target a specific LLM, let the user select one, or query multiple LLMs to compare performance and cost. Each LLM instance is identified by its id returned by this API.

Asking a Question

Use the Question and Answer API to submit a free-form natural language question. You need the systemId, the llmProviderId, and the question text. Dataworkz retrieves relevant data, augments the LLM prompt, and returns the response along with all authoritative sources used.

Getting Previously Asked Questions

Use this API to retrieve previously asked questions, their answers, and the quality scores associated with each LLM response.

Dataworkz RAG Builder abstracts the operational complexity of building a GenAI app and provides an API for developers to embed GenAI capabilities into existing workflows and applications.

Last updated