|
2 | 2 |
|
3 | 3 | ## About |
4 | 4 |
|
5 | | -A complete end-to-end rig including CrateDB, CrateDB MCPO, and Open WebUI. |
| 5 | +A complete end-to-end rig including CrateDB, CrateDB MCPO, and Open WebUI, |
| 6 | +including a touch of integration tests on CI/GHA. |
| 7 | + |
| 8 | +## Introduction |
6 | 9 |
|
7 | 10 | [Open WebUI] is an extensible, feature-rich, and user-friendly self-hosted AI |
8 | 11 | platform designed to operate entirely offline. It supports various LLM runners |
9 | 12 | like Ollama and OpenAI-compatible APIs, with built-in inference engine for RAG, |
10 | 13 | making it a powerful AI deployment solution. |
11 | 14 |
|
12 | | -CrateDB MCPO is a wrapper around CrateDB MCP, publishing the exposed tools via |
13 | | -OpenAPI, to connect it to Open WebUI. |
14 | | - |
15 | | -## What's inside |
| 15 | +CrateDB MCPO is an adapter wrapper around the [CrateDB MCP] server. Because |
| 16 | +Open WebUI uses [OpenAPI Tool Servers] to integrate external tooling and data |
| 17 | +sources into LLM agents and workflows, standard MCP servers need to adapt to |
| 18 | +how [Open WebUI MCP Support] works. |
16 | 19 |
|
17 | | -- `.env`: The dotenv file defines `OPENAI_API_KEY` for `compose.yml` and `OPEN_WEBUI_URL` for `setup.sh`. |
18 | | -- `compose.yml`: The service composition file defines three services: CrateDB, CrateDB MCPO, and Open WebUI. |
19 | | - Use it with `docker compose` or `podman compose`. |
20 | | -- `setup.Dockerfile`: Container runtime definition for `setup.sh`, including all requirements. |
21 | | -- `setup.sh`: Program that configures Open WebUI via HTTP API. |
22 | | -- `tool-servers.json`: JSON snippet for configuring the CrateDB MCPO server through `/api/v1/configs/tool_servers`. |
| 20 | +## Usage |
23 | 21 |
|
24 | | -## Operate |
| 22 | +### Start services |
25 | 23 |
|
26 | 24 | Configure the API key for OpenAI as environment variable, or define it within |
27 | 25 | the `.env` file. |
28 | 26 | ```shell |
29 | | -export OPENAI_API_KEY=<your_openapi_key> |
| 27 | +export OPENAI_API_KEY=<your_openai_api_key> |
30 | 28 | ``` |
31 | 29 |
|
32 | | -Spin up the software stack. |
| 30 | +Spin up the software stack. On the first occasion, it will take a while |
| 31 | +to download the OCI images and let Open WebUI do its thing on its first |
| 32 | +boot. |
33 | 33 | ```shell |
34 | | -docker compose up -d |
| 34 | +docker compose up |
35 | 35 | ``` |
36 | 36 |
|
37 | | -## Usage |
| 37 | +### User interface |
38 | 38 |
|
39 | | -You can access the services and their resources on those URLs. |
| 39 | +You can access the service's resources on those URLs. |
40 | 40 |
|
41 | 41 | - CrateDB: http://localhost:4200/ |
42 | | -- CrateDB MCPO: http://localhost:5200/docs, http://localhost:5200/openapi.json |
43 | | -- Open WebUI: http://localhost:6200/, http://localhost:6200/docs |
| 42 | +- Open WebUI: http://localhost:6200/ |
| 43 | + |
| 44 | +Explore the APIs here. |
| 45 | + |
| 46 | +- CrateDB MCPO: |
| 47 | + - Swagger: http://localhost:5200/docs |
| 48 | + - OpenAPI: http://localhost:5200/openapi.json |
| 49 | +- Open WebUI: |
| 50 | + - Swagger: http://localhost:6200/docs |
| 51 | + - OpenAPI: http://localhost:6200/openapi.json |
44 | 52 |
|
45 | | -## Configure |
| 53 | +### Configure |
46 | 54 |
|
47 | 55 | To make the ensemble work well, you need to configure a few bits on the Open WebUI |
48 | | -user interface after ramping up the rig. |
| 56 | +user interface. |
| 57 | + |
| 58 | +- Make sure to enable the "CrateDB" tool. The toggle switch is located within the |
| 59 | + flyout menu on the left side of the query prompt, which can be opened using the |
| 60 | + `More (+)` button. |
| 61 | + |
| 62 | +- In the "Chat Controls" flyout widget, located in the top right corner of the page, |
| 63 | + - make sure to enable `Function Calling: Native`, and |
| 64 | + - dial down to `Temperature: 0.0`. |
| 65 | + |
| 66 | +### Example questions |
49 | 67 |
|
50 | | -- Make sure to enable the "CrateDB" tool on the left side of the query prompt, |
51 | | - behind the "More (`+`)" button. |
52 | | -- Make sure to enable "Function Calling: Native" within the flyout widget about |
53 | | - "Chat Controls", to be opened in the top right corner of the screen. |
54 | | -- If you like, you can dial down to "Temperature: 0.5". |
| 68 | +Enjoy conversations with CrateDB (talk to your data) and its documentation |
| 69 | +(talk to your knowledgebase). |
55 | 70 |
|
56 | | -## Example questions |
| 71 | +- Text-to-SQL: _What is the average value for sensor 1?_ |
| 72 | +- Knowledgebase: _How do I use CrateDB with SQLAlchemy?_ |
57 | 73 |
|
58 | | -Enjoy conversations with CrateDB and its documentation. |
| 74 | +### Stop services |
| 75 | +Tear down services. |
| 76 | +```shell |
| 77 | +docker compose down |
| 78 | +``` |
| 79 | +Delete volumes. |
| 80 | +```shell |
| 81 | +docker volume rm open-webui_open-webui |
| 82 | +``` |
| 83 | +```shell |
| 84 | +docker volume rm open-webui_cratedb |
| 85 | +``` |
| 86 | + |
| 87 | +## What's inside |
| 88 | + |
| 89 | +- `.env`: The dotenv file defines `OPENAI_API_KEY` for `compose.yml` and `OPEN_WEBUI_URL` for `setup.sh`. |
| 90 | +- `compose.yml`: The service composition file defines three services: CrateDB, CrateDB MCPO, and Open WebUI. |
| 91 | + Use it with Docker or Podman. |
| 92 | +- `setup.Dockerfile`: Container runtime definition for `setup.sh`, including all requirements. |
| 93 | +- `setup.sh`: Program that configures Open WebUI via HTTP API. |
| 94 | +- `tool-servers.json`: JSON snippet for configuring the CrateDB MCPO server through `/api/v1/configs/tool_servers`. |
59 | 95 |
|
60 | | -- Text-to-SQL: What is the average value for sensor 1? |
61 | | -- Knowledgebase: How do I use CrateDB with SQLAlchemy? |
62 | 96 |
|
63 | 97 |
|
| 98 | +[CrateDB MCP]: https://cratedb.com/docs/guide/integrate/mcp/cratedb-mcp.html |
| 99 | +[OpenAPI Tool Servers]: https://docs.openwebui.com/openapi-servers/ |
64 | 100 | [Open WebUI]: https://docs.openwebui.com/ |
| 101 | +[Open WebUI MCP Support]: https://docs.openwebui.com/openapi-servers/mcp/ |
0 commit comments