Index your documentation files with SQLite AI-powered embeddings for intelligent search capabilities.
The SQLite AI Search Action automatically processes your documentation files and creates an AI-powered searchable database on SQLite Cloud. This action uses both embeddings to understand document content semantically and traditional full-text search, enabling more intelligent and contextual search results.
This action uses sqlite-rag.
- Downloads AI Model: Retrieves the specified Hugging Face model to generate embeddings for semantic search
- Processes Documents: Recursively scans and parses all documentation files in your repository
- Creates Dual Index: Generates both AI embeddings and traditional full-text search indices for comprehensive search capabilities
- Builds Database: Creates a SQLite database containing documents, embeddings, and search indices
- Uploads to SQLite Cloud: Transfers the complete database to your SQLite Cloud project
- Integrates with Edge Function: Works out-of-the-box with the predefined SQLite Cloud Edge Function template (aisearch-docs.js) for instant search functionality
Note: the SQLite Cloud Search Edge Function supports only the default model. Do not change the model settings if you want to use our search edge function.
-
Get your Connection String: Ensure you have a project on SQLite Cloud dashboard. If not, sign up to SQLite AI to create one for free.
-
Set GitHub Secret: Add your connection string as
SQLITECLOUD_CONNECTION_STRINGin your repository secrets. -
Add to Workflow: Create or update your GitHub workflow:
name: AI Search Index
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-search:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build AI Search Database
uses: sqliteai/sqlite-aisearch-action@v1
with:
connection_string: ${{ secrets.SQLITECLOUD_CONNECTION_STRING }}
base_url: https://docs.yoursite.com
database_name: aidocs_search.db
source_files: ./path/to/documentsTo enable search functionality on your indexed database, you need to create an Edge Function using the provided template:
- Access your dashboard on https://dashboard.sqlitecloud.io
- Enter the same project where the created database has been uploaded
- Go to the Edge Functions section
- Create a new
Javascript Functionand copy and paste the code from aisearch-docs.js in the editor - Deploy and test
-
Go in the Detail in the Edge Function panel and copy the Function URL
-
Execute a GET request and send a URL-econded query as
queryparameter.Example:
GET https://myproject.cloud/v2/functions/aisearch-docs?query=what%27s+Offsync%3F
Response example:
{
"data": {
"search": [
{
"id": "c41a6c2e-34e9-4e8e-92b9-41b8065047c7",
"uri": "docs/sqlite-cloud/sdks/php/methods.mdx",
"metadata": "{\"base_url\": \"https://docs.sqlitecloud.io/docs/\"}",
"snippet": "---\ntitle: OffSync\ndescription: Enable local-first applications with automatic data synchronization between edge devices and SQLite Cloud...",
"vec_rank": 1,
"fts_rank": null,
"combined_rank": 0.0163934426229508,
"vec_distance": 0.581515073776245,
"fts_score": null
},
...
]
}
}