You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-50Lines changed: 8 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,49 +1,16 @@
1
-
# AskBend: SQL-based Knowledge Base Search and Completion using Databend
2
-
## Demo https://ask.databend.rs/
3
-
4
-
AskBend is a Rust project that utilizes the power of Databend and OpenAI to create a SQL-based knowledge base from Markdown files.
5
-
6
-
Databend is a cloud-native data warehouse adept at storing and performing vector computations, making it suitable for this use case.
7
-
8
-
[Databend Cloud](https://databend.com) seamlessly integrates with OpenAI's capabilities, such as embedding generation, cosine distance calculation, and text completion. This integration means you don't need to interact with OpenAI directly; Databend Cloud manages everything.
9
-
10
-
The project automatically generates document embeddings from the content, enabling users to search and retrieve the most relevant information to their queries using SQL.
11
-
12
-
SQL-Based means you don't need any OpenAI API knowledge. With the Databend Cloud platform, you can perform these tasks using SQL. Some SQL AI functions of Databend Cloud include:
13
-
14
-
-[ai_embedding_vector](https://databend.rs/doc/sql-functions/ai-functions/ai-embedding-vector): Get the vector from OpenAI API
15
-
-[ai_text_completion](https://databend.rs/doc/sql-functions/ai-functions/ai-text-completion): Get the completion of a text
16
-
-[cosine_distance](https://databend.rs/doc/sql-functions/ai-functions/ai-cosine-distance): Calculate the distance between embedding vectors
1
+
# AskBend: Empower developers to explore & implement your knowledge base
17
2
18
-
## Overview
19
-
20
-
The project follows this general process:
3
+
## Demo https://ask.databend.rs/
21
4
22
-
1. Read and parse Markdown files from a directory.
23
-
2. Extract the content and store it in the askbend.doc table.
24
-
3. Compute embeddings for the content using Databend Cloud's built-in AI capabilities, including OpenAI's embedding generation, all through SQL.
25
-
4. When a user queries, generate the query embedding using Databend Cloud's SQL-based `ai_embedding_vector` function.
26
-
5. Perform a vector calculation to find the most relevant doc.content using Databend Cloud's SQL-based `cosine_distance` function.
27
-
6. Concatenate the retrieved content and use OpenAI's completion capabilities with Databend Cloud's SQL-based `ai_text_completion` function.
28
-
7. Output the completion result in Markdown format.
5
+
AskBend is a project built in Rust that leverages the [llmchain.rs](https://github.com/shafishlabs/llmchain.rs) library to create a SQL-based knowledge base from Markdown files.
The `--rebuild` flag rebuilds all the embeddings for the data directory. This process may take a few minutes, depending on the number of Markdown files.
97
55
98
56
99
-
### 6. Start the API server
57
+
### 5. Start the API server
100
58
101
59
```
102
60
./target/release/askbend -c conf/askbend.toml
103
61
```
104
62
105
-
### 7. Query your Markdown knowledge base using the API
63
+
### 6. Query your Markdown knowledge base using the API
106
64
```
107
65
curl -X POST -H "Content-Type: application/json" -d '{"query": "tell me how to do copy"}' http://localhost:8081/query
0 commit comments