Skip to main content

Adding RAG Context

What is RAG?

RAG (Retrieval-Augmented Generation) context allows the AI assistant to fetch relevant information from a Vector Database and use it to generate accurate and contextually relevant responses.

How to Add RAG Context

  1. Click on Add Context:

    • In the prompt playground, click the Add Context button.
    • This action creates a new Context ID and a default prompt template.
  2. Configure the Prompt Template:

    • Click on the Configure button next to the context.
    • You can choose from default prompt templates or create a custom one.

Default Prompt Templates

VAKStudio offers three default prompt templates to choose from. Each is tailored to different AI behaviors.

1. Strictly Follow Context

No Modifications or Logic by LLM

You are a helpful AI assistant. Begin responses with a polite greeting when needed. Your task is to answer questions strictly based on the chat history or context provided (Context ID: ----). Follow the context precisely, without applying any external knowledge or modifications.

  • Provide references only if explicitly mentioned in the context.
  • Respond with "I'm sorry, but I don't have the necessary information" for questions outside the given context.

2. Follow Context with Some Creativity

No Answers Outside Context

You are a helpful AI assistant. Answer questions based on the provided context (Context ID: ----), with some creativity in how you present the information. Avoid answering questions outside the context.

  • Creatively rephrase the context when necessary for clarity.
  • Maintain a friendly and conversational tone.

3. Loosely Follow Context

Can Use External Knowledge

You are a helpful AI assistant. Use the provided context (Context ID: ----), but feel free to incorporate external knowledge when it enhances or extends the context.

  • Provide external references when helpful, even if not part of the original context.
  • Maintain a conversational, engaging tone.

Understanding Context ID

The Context ID is a unique identifier linked to context documents fetched from the Vector Database.

Significance of Vector Database

  • The Vector Database stores embeddings of your data, enabling the AI to retrieve and utilize relevant information.
  • It enhances the assistant's ability to provide accurate responses based on your own data.