Skip to content

Commit 260a44c

Browse files
committed
feat(aisearch): aisearch-action guide
1 parent e9eab67 commit 260a44c

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

sqlite-cloud/_nav.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const sidebarNav: SidebarNavStruct = [
4444
{ title: "cloudsync_network_logout", filePath: "sqlite-sync-api-cloudsync-network-logout", type: "inner", level: 2 },
4545
{ title: "SQLite-Vector", filePath: "sqlite-vector", type: "inner", level: 0 },
4646
{ title: "MCP (Model Context Protocol)", filePath: "mcp-server", type: "inner", level: 0 },
47+
{ title: "AI Search for your documents", filePath: "aisearch-documents", type: "inner", level: 0 },
4748

4849
// ### CLOUD ###
4950
{ title: "Cloud", type: "secondary", icon: "docs-star",},
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: AI Search for your documents and files
3+
description: SQLite AI Search for your documents and files
4+
category: platform
5+
status: publish
6+
slug: aisearch-documents
7+
---
8+
9+
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.
11+
12+
The semantic search is powered by [SQLite RAG](https://github.com/sqliteai/sqlite-rag).
13+
14+
## Set Up Your GitHub Workflow
15+
16+
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.
17+
18+
2. **Set GitHub Secret**: Add your connection string as `SQLITECLOUD_CONNECTION_STRING` in your repository secrets.
19+
20+
3. **Add to Workflow**: Create or update your GitHub workflow:
21+
22+
```yaml
23+
name: AI Search Index
24+
25+
on:
26+
push:
27+
branches: [main]
28+
workflow_dispatch:
29+
30+
jobs:
31+
build-search:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Build AI Search Database
37+
uses: sqliteai/sqlite-aisearch-action@v1
38+
with:
39+
connection_string: ${{ secrets.SQLITECLOUD_CONNECTION_STRING }}
40+
base_url: https://docs.yoursite.com
41+
database_name: aidocs_search.db
42+
source_files: ./path/to/documents
43+
```
44+
45+
## Create the Search Edge Function
46+
47+
To enable search functionality on your indexed database, create an Edge Function using the provided template:
48+
49+
1. Access your dashboard at https://dashboard.sqlitecloud.io
50+
2. Navigate to the same project where your database was uploaded
51+
3. Go to the **Edge Functions** section
52+
![AISearch Edge Function](@docs-website-assets/aisearch-docs/edgefn_aisearch.png)
53+
4. Create a new `Javascript Function` and copy the code from [aisearch-docs.js](https://github.com/sqliteai/sqlite-aisearch-action/blob/main/search_edge_function_template/aisearch-docs.js) into the editor
54+
5. Deploy and test
55+
56+
### How to Perform a Search
57+
58+
1. Go to **Details** in the Edge Function panel and copy the **Function URL**
59+
![AISearch Edge Function Details](@docs-website-assets/aisearch-docs/edgefn_aisearch_details.png)
60+
2. Execute a GET request with a URL-encoded query as the `query` parameter
61+
62+
Example:
63+
```
64+
GET https://myproject.cloud/v2/functions/aisearch-docs?query=what%27s+Offsync%3F
65+
```

0 commit comments

Comments
 (0)