Merge branch 'open-webui:main' into main

This commit is contained in:
mhand 2024-11-01 17:26:10 +11:00 committed by GitHub
commit 361d992075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 124 additions and 7 deletions

View File

@ -227,16 +227,28 @@ services:
- 4180:4180/tcp
```
### Authentik
To configure a [Authentik](https://goauthentik.io/) OAuth client, please refer to [documentation](https://docs.goauthentik.io/docs/applications) on how to create an application and `OAuth2/OpenID Provider`.
The allowed redirect URI should include `<open-webui>/oauth/oidc/callback`.
While creating provider, please note `App-name`, `Client-ID` and `Client-Secret` and use it for open-webui environment variables:
```
- 'ENABLE_OAUTH_SIGNUP=true'
- 'OAUTH_MERGE_ACCOUNTS_BY_EMAIL=true'
- 'OAUTH_PROVIDER_NAME=Authentik'
- 'OPENID_PROVIDER_URL=https://<authentik-url>/application/o/<App-name>/.well-known/openid-configuration'
- 'OAUTH_CLIENT_ID=<Client-ID>'
- 'OAUTH_CLIENT_SECRET=<Client-Secret>'
- 'OAUTH_SCOPES=openid email profile'
- 'OPENID_REDIRECT_URI=https://<open-webui>/oauth/oidc/callback'
```
### Authelia
[Authelia](https://www.authelia.com/) can be configured to return a header for use with trusted header authentication.
Documentation is available [here](https://www.authelia.com/integration/trusted-header-sso/introduction/).
No example configs are provided due to the complexity of deploying Authelia.
### Authentik
[Authentik](https://goauthentik.io/) can be configured to return a header for use with trusted header authentication.
Documentation is available [here](https://docs.goauthentik.io/docs/providers/proxy/).
No example configs are provided due to the complexity of deploying Authentik.

View File

@ -0,0 +1,105 @@
---
sidebar_position: 3
title: "Open WebUI RAG Tutorial"
---
:::warning
This tutorial is a community contribution and is not supported by the OpenWebUI team. It serves only as a demonstration on how to customize OpenWebUI for your specific use case. Want to contribute? Check out the contributing tutorial.
:::
# Tutorial: Configuring RAG with OpenWebUI Documentation
In this tutorial, you will learn how to use **Retrieval-Augmented Generation (RAG)** with OpenWebUI to load real-world documentation as a knowledge base. We will walk through how to use the latest **OpenWebUI Documentation** as an example for this setup.
---
## Overview
### What is RAG?
Retrieval-Augmented Generation (RAG) combines **LLMs** with **retrieved knowledge** from external sources. The system retrieves relevant data from uploaded documents or knowledge bases, enhancing the quality and accuracy of responses.
This tutorial demonstrates how to:
- Upload the latest OpenWebUI Documentation as a knowledge base.
- Connect it to a custom model.
- Query the knowledge base for enhanced assistance.
---
## Setup
### Step-by-Step Setup: OpenWebUI Documentation as Knowledge Base
Follow these steps to set up RAG with **OpenWebUI Documentation**:
1. **Download the Documentation**:
- Download the latest documentation:
[https://github.com/open-webui/docs/archive/refs/heads/main.zip](https://github.com/open-webui/docs/archive/refs/heads/main.zip)
2. **Extract the Files**:
- Extract the `main.zip` file to get all documentation files.
3. **Locate the Markdown Files**:
- In the extracted folder, locate all files with `.md` and `.mdx`extensions (tip: search for `*.md*`).
4. **Create a Knowledge Base**:
- Navigate to **Workspace** > **Knowledge** > **+ Create a Knowledge Base**.
- Name it: `OpenWebUI Documentation`
- Purpose: **Assistance**
> Click **Create Knowledge**.
5. **Upload the Files**:
- Drag and drop the `.md` and `.mdx` files from the extracted folder into the **OpenWebUI Documentation** knowledge base.
---
## Create and Configure the Model
### Create a Custom Model with the Knowledge Base
1. **Navigate to Models**:
- Go to **Workspace** > **Models** > **+ Add New Model**.
2. **Configure the Model**:
- **Name**: `OpenWebUI`
- **Base Model**: *(Select the appropriate Llama or other available model)*
- **Knowledge Source**: Select **OpenWebUI Documentation** from the dropdown.
3. **Save the Model**.
---
## Examples and Usage
### Query the OpenWebUI Documentation Model
1. **Start a New Chat**:
- Navigate to **New Chat** and select the `OpenWebUI` model.
2. **Example Queries**:
```
User: "How do I configure environment variables?"
System: "Refer to Section 3.2: Use the `.env` file to manage configurations."
```
```
User: "How do I update OpenWebUI using Docker?"
System: "Refer to `docker/updating.md`: Use `docker pull` and restart the container."
```
With the RAG-enabled model, the system retrieves the most relevant sections from the documentation to answer your query.
---
## Next Steps
### Next Steps
- **Add More Knowledge**: Continue expanding your knowledge base by adding more documents.
---
With this setup, you can effectively use the **OpenWebUI Documentation** to assist users by retrieving relevant information for their queries. Enjoy building and querying your custom knowledge-enhanced models!