Skip to content

Commit 5dd6ccb

Browse files
committed
chore: update aisearch-documents w/ docs-chatbot integration
1 parent 260a44c commit 5dd6ccb

File tree

1 file changed

+59
-3
lines changed

1 file changed

+59
-3
lines changed

sqlite-cloud/sqlite-ai/aisearch-documents.mdx

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ slug: aisearch-documents
77
---
88

99
This guide shows you how to set up a ready-to-use AI semantic search for your documents and files.
10-
Using the [sqlite-aisearch-action](https://github.com/sqliteai/sqlite-aisearch-action), you can integrate document processing into your GitHub workflow and set up a chat bot on your site in just a few steps.
10+
Using the [sqlite-aisearch-action](https://github.com/sqliteai/sqlite-aisearch-action), you can integrate document processing into your GitHub workflow and set up a chatbot on your site in just a few steps.
1111

1212
The semantic search is powered by [SQLite RAG](https://github.com/sqliteai/sqlite-rag).
1313

14-
## Set Up Your GitHub Workflow
14+
## Step 1: Set Up Your GitHub Workflow
1515

1616
1. **Get Your Connection String**: Ensure you have a project on the [SQLite Cloud dashboard](https://dashboard.sqlitecloud.io). If not, sign up for [SQLite AI](https://sqlite.ai) to create one for free.
1717

@@ -42,7 +42,7 @@ jobs:
4242
source_files: ./path/to/documents
4343
```
4444
45-
## Create the Search Edge Function
45+
## Step 2: Create the Search Edge Function
4646
4747
To enable search functionality on your indexed database, create an Edge Function using the provided template:
4848
@@ -63,3 +63,59 @@ To enable search functionality on your indexed database, create an Edge Function
6363
```
6464
GET https://myproject.cloud/v2/functions/aisearch-docs?query=what%27s+Offsync%3F
6565
```
66+
67+
## Integrate the Docs Chatbot in Your Website
68+
69+
Once you have your search edge function deployed, you can easily add an interactive AI chatbot to your website. The chatbot provides a user-friendly interface for your documentation search, powered by the indexed content.
70+
71+
### React Integration
72+
73+
Install the chatbot package:
74+
75+
```bash
76+
npm install @sqliteai/docs-chatbot
77+
```
78+
79+
Then add it to your React application:
80+
81+
```tsx
82+
import { DocsChatbot } from "@sqliteai/docs-chatbot";
83+
import "@sqliteai/docs-chatbot/style.css";
84+
85+
function App() {
86+
return (
87+
<DocsChatbot
88+
searchUrl="https://yourproject.sqlite.cloud/v2/functions/aisearch-docs"
89+
apiKey="your-api-key"
90+
title="Help Center"
91+
/>
92+
);
93+
}
94+
```
95+
96+
### Vanilla JavaScript
97+
98+
For non-React applications, use the web component:
99+
100+
```html
101+
<!DOCTYPE html>
102+
<html lang="en">
103+
<head>
104+
<meta charset="UTF-8" />
105+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
106+
</head>
107+
<body>
108+
<script src="https://unpkg.com/@sqliteai/docs-chatbot/dist/umd/docs-chatbot.min.js"></script>
109+
110+
<docs-chatbot
111+
search-url="https://yourproject.sqlite.cloud/v2/functions/aisearch-docs"
112+
api-key="your-api-key"
113+
title="Help Center"
114+
>
115+
</docs-chatbot>
116+
</body>
117+
</html>
118+
```
119+
120+
By default, the chatbot displays as a floating button in the bottom-right corner.
121+
For advanced configuration options including custom triggers, theming, and API reference, see the [full docs chatbot documentation](https://github.com/sqliteai/docs-chatbot).

0 commit comments

Comments
 (0)