{"id":48344340,"url":"https://github.com/neverinfamous/wiki-search-worker","last_synced_at":"2026-04-05T06:03:00.199Z","repository":{"id":326464363,"uuid":"1068159908","full_name":"neverinfamous/wiki-search-worker","owner":"neverinfamous","description":"Cloudflare Worker powering AI Search for adamic-blog.","archived":false,"fork":false,"pushed_at":"2026-03-11T02:23:45.000Z","size":506,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-11T07:56:41.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://search.adamic.tech/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neverinfamous.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T00:17:35.000Z","updated_at":"2026-03-11T02:23:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/neverinfamous/wiki-search-worker","commit_stats":null,"previous_names":["neverinfamous/wiki-search-worker"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/neverinfamous/wiki-search-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverinfamous%2Fwiki-search-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverinfamous%2Fwiki-search-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverinfamous%2Fwiki-search-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverinfamous%2Fwiki-search-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverinfamous","download_url":"https://codeload.github.com/neverinfamous/wiki-search-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverinfamous%2Fwiki-search-worker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31426193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T02:22:46.605Z","status":"ssl_error","status_checked_at":"2026-04-05T02:22:33.263Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-05T06:03:00.110Z","updated_at":"2026-04-05T06:03:00.178Z","avatar_url":"https://github.com/neverinfamous.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wiki Search Worker - Complete Documentation\n\n**Production URL**: https://search.adamic.tech\n**Worker Name**: `sqlite-wiki-search`\n**AI Search ID**: `sqlite-mcp-server-wiki`\n**GitHub Repo**: https://github.com/neverinfamous/wiki-search-worker\n\nPublic AI-powered search interface for the SQLite MCP Server documentation using Cloudflare Workers + AI Search (formerly AutoRAG).\n\n---\n\n## 📋 Table of Contents\n\n- [Overview](#overview)\n- [Architecture](#architecture)\n- [Automated Deployment](#automated-deployment)\n- [Local Development](#local-development)\n- [Configuration](#configuration)\n- [AI Search Setup](#ai-search-setup)\n- [API Endpoints](#api-endpoints)\n- [Maintenance](#maintenance)\n- [Security](#security)\n- [Troubleshooting](#troubleshooting)\n- [Integration Examples](#integration-examples)\n\n---\n\n## 🎯 Overview\n\nThis Cloudflare Worker provides an AI-powered search interface for the [SQLite MCP Server Wiki](https://github.com/neverinfamous/sqlite-mcp-server.wiki). It uses Cloudflare's AI Search technology to deliver intelligent, context-aware answers from the complete wiki documentation.\n\n### Features\n\n- 🤖 **AI-Enhanced Search** - Natural language answers with source attribution\n- ⚡ **Vector Search** - Fast semantic search across all documentation\n- 📚 **Complete Coverage** - Searches documentation across 6 projects (MySQL MCP, SQLite MCP, PostgreSQL MCP, Memory Journal MCP, R2 Bucket Manager, KV Manager)\n- 🎯 **Context-Aware** - Understands questions and provides relevant examples\n- 🌙 **Dark Mode** - Automatic theme detection\n- 📱 **Mobile Responsive** - Works on all devices\n- 🔒 **Rate Limited** - DDoS protection via Cloudflare WAF\n- 🔄 **Automated CI/CD** - GitHub Actions deployment pipeline\n\n### Performance\n\n- **Search Latency**: \u003c 500ms (AI-enhanced), \u003c 100ms (vector search)\n- **Global Edge**: Deployed to 300+ Cloudflare data centers\n- **Uptime**: 99.99% SLA via Cloudflare\n- **Cost**: ~$5/month (Workers + R2 + AI Search)\n\n---\n\n## 🏗️ Architecture\n\n### Flow Diagram\n\n```\nGitHub Wiki → GitHub Actions → R2 Bucket → AI Search Index → Worker → Users\n```\n\n### Components\n\n- **Cloudflare Worker** (`wiki-search-worker/`) - Serverless search interface\n- **R2 Bucket** (`sqlite-mcp-server-wiki`) - Storage for wiki markdown files\n- **AI Search** - Managed search and indexing service (auto-syncs every 6 hours)\n- **GitHub Actions** - Automated deployment pipeline\n\n### Technology Stack\n\n- **Runtime**: Cloudflare Workers (Edge compute)\n- **Storage**: Cloudflare R2 (19 markdown files)\n- **AI Engine**: Cloudflare AI Search with Workers AI binding\n- **Search Backend**: Vector database with automatic indexing\n- **Language**: TypeScript\n- **Build Tool**: Wrangler CLI\n- **CI/CD**: GitHub Actions\n\n---\n\n## 🚀 Automated Deployment\n\nEvery push to `main` branch automatically:\n\n1. ✅ **Deploys Worker** to Cloudflare Edge\n2. ✅ **Clones wiki repository** from GitHub\n3. ✅ **Uploads files** to R2 bucket (with `--remote` flag)\n4. ⚠️ **Requires manual sync** - Click \"Sync Index\" in dashboard (or wait 6 hours)\n\n### GitHub Actions Workflow\n\n**File**: `.github/workflows/deploy.yml`\n\n**Triggers**:\n\n- Push to `main` branch\n- Manual workflow dispatch\n\n**Steps**:\n\n1. Checkout repository\n2. Setup Node.js 20.x\n3. Install dependencies (`npm ci`)\n4. Deploy Worker (`wrangler deploy --env=\"\"`)\n5. Clone wiki repository\n6. Upload markdown files to R2\n7. Display sync instructions\n\n### GitHub Secrets Required\n\n| Secret Name             | Purpose                                                        |\n| ----------------------- | -------------------------------------------------------------- |\n| `CLOUDFLARE_API_TOKEN`  | API authentication (see [Token Setup](#creating-an-api-token)) |\n| `CLOUDFLARE_ACCOUNT_ID` | Account identification (found in Cloudflare dashboard URL)     |\n\n**Token Permissions**: Workers Scripts (Edit), R2 (Edit), Account Settings (Read)\n\n#### Creating an API Token\n\n1. Go to https://dash.cloudflare.com/profile/api-tokens\n2. Click **Create Token**\n3. Use the **Edit Cloudflare Workers** template\n4. Add **R2:Edit** permission\n5. Scope to your account\n\n### Initial Setup (One-Time)\n\n```bash\n# Clone the repository\ngit clone https://github.com/neverinfamous/wiki-search-worker.git\ncd wiki-search-worker\n\n# Install dependencies\nnpm install\n\n# Add GitHub secrets (via GitHub UI)\n# Go to: Settings → Secrets and variables → Actions\n# Add: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID\n\n# Push to trigger deployment\ngit push\n```\n\n---\n\n## 💻 Local Development\n\n### Prerequisites\n\n- Node.js 20.x or later\n- npm or yarn\n- Cloudflare account with Workers access\n- Wrangler CLI\n\n### Setup\n\nNavigate to worker directory:\n\n```bash\ncd C:\\Users\\chris\\Desktop\\wiki-search-worker\n```\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nRun locally:\n\n```bash\nnpm run dev\n# Worker available at http://localhost:8787\n```\n\nDeploy to production:\n\n```bash\nnpm run deploy\n```\n\n### Project Structure\n\n```\nwiki-search-worker/\n├── .github/\n│   ├── workflows/\n│   │   └── deploy.yml          # GitHub Actions CI/CD\n│   └── dependabot.yml          # Dependency updates\n├── src/\n│   └── index.ts                # Main Worker code\n├── wrangler.toml               # Worker configuration\n├── package.json                # Dependencies\n├── tsconfig.json               # TypeScript config\n├── DEPLOYMENT.md               # Deployment guide\n├── SECURITY.md                 # Security policy\n├── README.md                   # Project overview\n└── API_TOKEN_SETUP.md          # Token creation guide\n```\n\n---\n\n## ⚙️ Configuration\n\n### Wrangler Configuration (`wrangler.toml`)\n\n```toml\nname = \"sqlite-wiki-search\"\nmain = \"src/index.ts\"\ncompatibility_date = \"2025-01-01\"\ncompatibility_flags = [\"nodejs_compat\"]\n# account_id loaded from CLOUDFLARE_ACCOUNT_ID env var or set here\n\n# AI binding for AutoRAG access\n[ai]\nbinding = \"AI\"\n\n# Environment variables\n[vars]\nALLOWED_ORIGINS = \"*\"\n\n# Production configuration\n[env.production]\nvars = { ALLOWED_ORIGINS = \"https://adamic.tech\" }\n\n# Custom domain route\nroutes = [\n  { pattern = \"adamic.tech/wiki-search/*\", zone_name = \"adamic.tech\" }\n]\n```\n\n### Custom Domain\n\n**Domain**: `search.adamic.tech`\n**DNS Record**: Automatically created by Cloudflare\n**SSL**: Auto-provisioned with Let's Encrypt\n**CDN**: Enabled via Cloudflare proxy\n\n### Rate Limiting (Cloudflare WAF)\n\n**Rule 1: Burst Protection**\n\n- Path: `/api/search`\n- Characteristic: IP Address\n- Limit: 20 requests per 10 seconds\n- Action: Block for 30 seconds\n\n**Rule 2: Sustained Protection**\n\n- Hostname: `search.adamic.tech`\n- Characteristic: IP Address\n- Limit: 100 requests per 1 minute\n- Action: Block for 10 minutes\n\n---\n\n## 🔧 AI Search Configuration\n\n### AI Search Details\n\n- **AI Search ID**: `sqlite-mcp-server-wiki`\n- **R2 Source Bucket**: `sqlite-mcp-server-wiki`\n- **Wiki Sources**:\n    - MySQL MCP: `C:\\Users\\chris\\Desktop\\mysql-mcp.wiki` → `mysql-mcp/` folder\n    - SQLite MCP: `C:\\Users\\chris\\Desktop\\sqlite-mcp-server.wiki` → `sqlite/` folder\n    - PostgreSQL MCP: `C:\\Users\\chris\\Desktop\\postgres-mcp.wiki` → `postgres/` folder\n    - Memory Journal MCP: `C:\\Users\\chris\\Desktop\\memory-journal-mcp.wiki` → `memory-journal/` folder\n    - R2 Bucket Manager: `C:\\Users\\chris\\Desktop\\R2-Manager-Worker.wiki` → `r2-manager/` folder\n    - KV Manager: `C:\\Users\\chris\\Desktop\\kv-manager.wiki` → `kv-manager/` folder\n- **Total Content**: 60+ markdown files across all projects\n- **Auto-Sync**: Every 6 hours automatically\n\n### MCP Server Access\n\n**Enable in Cursor/Claude Desktop** (`mcp.json`):\n\n```json\n{\n    \"mcpServers\": {\n        \"cloudflare-autorag\": {\n            \"command\": \"npx\",\n            \"args\": [\"-y\", \"mcp-remote@latest\", \"https://autorag.mcp.cloudflare.com/sse\"],\n            \"env\": {\n                \"CLOUDFLARE_API_TOKEN\": \"\u003cyour-api-token\u003e\",\n                \"CLOUDFLARE_ACCOUNT_ID\": \"\u003cyour-account-id\u003e\"\n            }\n        }\n    }\n}\n```\n\n**Available MCP Tools**:\n\n```javascript\n// List all AI Search instances\nmcp_cloudflare - autorag_list_rags();\n\n// Search the index\nmcp_cloudflare -\n    autorag_search({\n        rag_id: 'sqlite-mcp-server-wiki',\n        query: 'How do I use JSON helper tools?',\n    });\n\n// AI-enhanced search\nmcp_cloudflare -\n    autorag_ai_search({\n        rag_id: 'sqlite-mcp-server-wiki',\n        query: 'What statistical analysis tools are available?',\n    });\n```\n\n### Syncing Content\n\n**When to sync**: After wiki updates are pushed to R2\n\n**Auto-Sync**:\n\n- Happens automatically every 6 hours\n- No action required for most updates\n\n**Manual Sync** (for immediate updates):\n\n1. Go to: Cloudflare Dashboard → AI → AI Search → `sqlite-mcp-server-wiki`\n2. Click **\"Sync Index\"** button\n3. Wait for completion (~1-2 minutes)\n4. Verify with a test query\n\n**Note**: Manual sync API endpoint does not exist. Dashboard-only operation.\n\n### Local Wiki Sync Script\n\n**PowerShell Script**: Use `sync-wikis-to-r2.ps1` for manual syncing from local wikis\n\n```powershell\n# Set required environment variables (one-time setup)\n$env:CLOUDFLARE_API_TOKEN = \"\u003cyour-api-token\u003e\"\n$env:CLOUDFLARE_ACCOUNT_ID = \"\u003cyour-account-id\u003e\"\n\n# Sync all wikis\n.\\sync-wikis-to-r2.ps1\n\n# Sync specific wiki only\n.\\sync-wikis-to-r2.ps1 -WikiName r2-manager\n.\\sync-wikis-to-r2.ps1 -WikiName kv-manager\n.\\sync-wikis-to-r2.ps1 -WikiName sqlite\n.\\sync-wikis-to-r2.ps1 -WikiName postgres\n.\\sync-wikis-to-r2.ps1 -WikiName memory-journal\n```\n\n**After running the script**: Go to the Cloudflare dashboard and click \"Sync Index\" or wait for automatic sync.\n\n---\n\n## 🆕 Adding New Wikis to AI Search\n\n**Follow these steps to add a new project wiki to the AI Search system:**\n\n### 1. Add Wiki to Local Sync Script\n\nEdit `sync-wikis-to-r2.ps1` and add your new wiki to the `$wikis` hash table:\n\n```powershell\n$wikis = @{\n    # ... existing wikis ...\n    'your-project' = @{\n        Path = \"$BASE_PATH\\your-project.wiki\"\n        Folder = \"your-project\"\n        DisplayName = \"Your Project Name\"\n    }\n}\n```\n\n### 2. Add Wiki to GitHub Actions Workflow\n\nEdit `.github/workflows/deploy.yml` and add these steps before \"Step 6\":\n\n```yaml\n- name: Clone Your Project wiki repository\n  run: |\n      git clone https://github.com/yourusername/your-project.wiki.git your-project-wiki-temp\n\n- name: Upload Your Project wiki files to R2\n  run: |\n      cd your-project-wiki-temp\n      for file in *.md; do\n        echo \"Uploading $file to R2 (your-project folder)...\"\n        npx wrangler r2 object put sqlite-mcp-server-wiki/your-project/\"$file\" --file=\"$file\" --remote\n      done\n  env:\n      CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n      CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}\n```\n\nUpdate the deployment summary to include your new wiki.\n\n### 3. Configure R2 Bucket Folder Structure\n\nThe R2 bucket uses this structure:\n\n```\nsqlite-mcp-server-wiki/\n├── sqlite/          # SQLite MCP Server wiki files\n├── postgres/        # PostgreSQL MCP Server wiki files\n├── memory-journal/  # Memory Journal MCP wiki files\n├── r2-manager/      # R2 Bucket Manager wiki files\n├── kv-manager/      # KV Manager wiki files\n└── your-project/    # Your new project wiki files\n```\n\n### 4. Initial Sync\n\nAfter adding the configuration:\n\n**Option A: Local Sync (Fast)**\n\n```powershell\n.\\sync-wikis-to-r2.ps1 -WikiName your-project\n```\n\n**Option B: GitHub Actions (Automatic)**\n\n- Commit and push your changes\n- GitHub Actions will automatically sync all wikis\n- Check Actions tab for progress\n\n### 5. Trigger AutoRAG Index Sync\n\nAfter files are in R2, sync the search index:\n\n1. Go to: Cloudflare Dashboard → AI → AI Search → `sqlite-mcp-server-wiki`\n2. Click **\"Sync Index\"** button\n3. Wait 1-2 minutes for completion\n4. Test search at: https://search.adamic.tech\n\n### 6. Update Documentation\n\nUpdate these files to document the new wiki:\n\n- `wiki-search-worker/README.md` - Add to wiki sources list\n- `adamic-blog/README.md` - Add to supported projects\n- Both files: Update feature counts and descriptions\n\n### 7. Verify Integration\n\nTest that your wiki content is searchable:\n\n```bash\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"content from your new wiki\", \"mode\": \"ai\"}'\n```\n\n### Common Gotchas\n\n- ✅ **R2 folder names**: Use lowercase with hyphens (e.g., `your-project`, not `YourProject`)\n- ✅ **Wiki path**: Ensure the local wiki path exists and contains `.md` files\n- ✅ **GitHub URL**: Use the correct `.wiki.git` repository URL\n- ✅ **Environment variables**: Both `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` must be set\n- ✅ **Manual sync**: Always click \"Sync Index\" after uploading to R2 for immediate updates\n\n### R2 Bucket Configuration\n\n**Bucket Name**: `sqlite-mcp-server-wiki`\n**Region**: Automatic (Cloudflare's global network)\n**Public Access**: No (AI Search has direct binding)\n**File Format**: Markdown (`.md`) files only\n**Auto-Upload**: Via GitHub Actions on every push\n\n## 📡 API Endpoints\n\n### Web Interface (Primary)\n\n- **URL**: https://search.adamic.tech\n- **Features**:\n    - AI-Enhanced mode with natural language synthesis\n    - Vector Search mode for raw document chunks\n    - Example queries\n    - Social sharing\n    - Dark mode support\n\n### API Endpoint\n\n- **URL**: https://search.adamic.tech/api/search\n- **Method**: POST\n- **Content-Type**: application/json\n\n**Request Body Parameters**:\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `query` | string | (required) | Search query (3-500 characters) |\n| `mode` | string | `\"ai\"` | `\"ai\"` for synthesized answers, `\"search\"` for raw chunks |\n| `max_results` | number | `5` | Maximum results to return (up to 50) |\n| `rewrite` | boolean | (auto) | Override automatic query rewriting. By default, the system uses smart detection to skip rewriting for specific queries (tool names, quoted terms, action verbs) to save ~100-200ms. |\n\n### Search with AI (Recommended)\n\nGet natural language answers synthesized from the wiki:\n\n```bash\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"How do I use JSON helper tools?\", \"mode\": \"ai\"}'\n```\n\n**Response format**:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"response\": \"The JSON Helper Tools in SQLite MCP Server v2.6.0...\",\n    \"data\": [\n      {\n        \"filename\": \"JSON-Helper-Tools.md\",\n        \"score\": 0.92,\n        \"content\": [...]\n      }\n    ]\n  }\n}\n```\n\n### Raw Document Search\n\nGet unprocessed wiki chunks for detailed exploration:\n\n```bash\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"vector search\", \"mode\": \"search\"}'\n```\n\n### Health Check\n\n```bash\ncurl https://search.adamic.tech/health\n```\n\n---\n\n## 🔄 Maintenance\n\n### Updating Search Content\n\n**When wiki is updated**:\n\n1. Navigate to: Cloudflare Dashboard → AI → AutoRAG\n2. Select `sqlite-mcp-server-wiki`\n3. Click **Sync** button\n4. Wait for sync completion (~1-2 minutes)\n5. Test search with updated query\n\n**Verify sync**:\n\n```bash\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"latest features\"}'\n```\n\n### Redeploying the Worker\n\n**When code changes**:\n\n```bash\ncd C:\\Users\\chris\\Desktop\\sqlite-mcp-server\\wiki-search-worker\nnpm run deploy\n```\n\n**When dependencies update**:\n\n```bash\nnpm install\nnpm audit fix\nnpm run deploy\n```\n\n### Monitoring\n\n**Check worker logs**:\n\n1. Cloudflare Dashboard → Workers \u0026 Pages\n2. Select `sqlite-wiki-search`\n3. View **Logs** tab\n\n**Analytics location**:\n\n- Dashboard → Workers \u0026 Pages → sqlite-wiki-search → Metrics\n- Rate limiting: Security → WAF → Rate limiting rules\n\n---\n\n## 🛠️ Troubleshooting\n\n### Issue: Worker not updating after deploy\n\n**Solution**:\n\n- Clear Cloudflare cache: Caching → Configuration → Purge Everything\n- Check deployment logs for errors\n- Verify `wrangler.toml` configuration\n\n### Issue: Search returns outdated results\n\n**Solution**:\n\n- Sync AutoRAG in dashboard (AI → AutoRAG → Sync)\n- Verify wiki source files are updated\n- Check AutoRAG sync timestamp\n\n### Issue: Rate limiting blocking legitimate users\n\n**Solution**:\n\n1. Check WAF logs: Security → Events\n2. Adjust rate limits if needed\n3. Add IP exceptions in WAF if necessary\n\n### Issue: CORS errors\n\n**Solution**:\n\n- Check `ALLOWED_ORIGINS` in `wrangler.toml`\n- Currently set to `\"*\"` for public access\n- Modify `src/index.ts` CORS headers if needed\n\n### Issue: TypeScript errors after changes\n\n**Solution**:\n\n```bash\n# Add types back to tsconfig.json if removed\n# File: tsconfig.json\n{\n  \"compilerOptions\": {\n    \"types\": [\"@cloudflare/workers-types\"]\n  }\n}\n```\n\n### Issue: NPM audit vulnerabilities\n\n**Solution**:\n\n- Check `package.json` for `overrides` section\n- Current overrides: `esbuild` to `^0.25.10`, `undici` to `^7.24.4`\n- Run `npm audit fix` for automated fixes\n\n---\n\n## 📚 File Locations\n\n### Worker Code\n\n- **GitHub**: https://github.com/neverinfamous/wiki-search-worker\n- **Local**: `C:\\Users\\chris\\Desktop\\wiki-search-worker\\`\n- **Main Worker**: `src/index.ts`\n- **Config**: `wrangler.toml`\n- **Package**: `package.json`\n- **CI/CD**: `.github/workflows/deploy.yml`\n- **Security**: `SECURITY.md`\n- **Deployment Guide**: `DEPLOYMENT.md`\n\n### Wiki Source\n\n- **GitHub**: https://github.com/neverinfamous/sqlite-mcp-server.wiki\n- **Local**: `C:\\Users\\chris\\Desktop\\sqlite-mcp-server.wiki\\`\n- **Files**: 19 markdown files\n- **Main entry**: `Home.md`\n\n### Documentation\n\n- **This file**: `C:\\Users\\chris\\Desktop\\docs_images\\wiki_autorag.md`\n- **Main Project**: https://github.com/neverinfamous/sqlite-mcp-server\n\n---\n\n## 🔗 Related Repositories\n\n- **[sqlite-mcp-server](https://github.com/neverinfamous/sqlite-mcp-server)** - Main project\n- **[sqlite-mcp-server.wiki](https://github.com/neverinfamous/sqlite-mcp-server.wiki)** - Wiki source\n- **[wiki-search-worker](https://github.com/neverinfamous/wiki-search-worker)** - This worker\n\n---\n\n## 📖 Additional Documentation\n\n**In wiki-search-worker repository**:\n\n- `README.md` - Project overview and quick start\n- `DEPLOYMENT.md` - Complete deployment guide\n- `SECURITY.md` - Security policy and reporting\n- `API_TOKEN_SETUP.md` - API token creation guide\n- `CREATE_API_TOKEN.md` - Detailed token instructions\n\n**Features**:\n\n- Dependabot configuration for automated updates\n- GitHub Actions for CI/CD\n- Comprehensive security policy\n- Complete API documentation\n\n## 🎯 Integration Examples\n\n### JavaScript\n\n```javascript\nconst result = await fetch('https://search.adamic.tech/api/search', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n        query: 'statistical analysis tools',\n        mode: 'ai', // or 'search' for raw results\n    }),\n});\nconst data = await result.json();\nconsole.log(data.data.response); // AI-synthesized answer\nconsole.log(data.data.data); // Source documents\n```\n\n### Python\n\n```python\nimport requests\n\nresponse = requests.post(\n    'https://search.adamic.tech/api/search',\n    json={\n        'query': 'How do I backup my database?',\n        'mode': 'ai'\n    }\n)\n\nresult = response.json()\nprint(result['data']['response'])  # AI answer\n\n# Access sources\nfor source in result['data']['data']:\n    print(f\"Source: {source['filename']} (Score: {source['score']})\")\n```\n\n### cURL with Mode Selection\n\n```bash\n# AI mode (synthesized answer)\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"vector search\", \"mode\": \"ai\"}'\n\n# Search mode (raw chunks)\ncurl -X POST https://search.adamic.tech/api/search \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\": \"vector search\", \"mode\": \"search\"}'\n```\n\n---\n\n## 💰 Cost \u0026 Performance\n\n### Cloudflare Costs\n\n- **Workers**: Free tier includes 100,000 requests/day\n- **AutoRAG**: Pay-as-you-go pricing\n    - AI-Enhanced queries: ~$0.01 per query (synthesis cost)\n    - Vector search only: ~$0.001 per query\n- **Bandwidth**: Included in Workers free tier\n\n### Performance Metrics\n\n- **Cold start**: ~100-200ms\n- **AI search**: ~1-3 seconds (includes synthesis)\n- **Vector search**: ~200-500ms (raw results)\n- **Edge locations**: 300+ worldwide\n\n### Rate Limits (Current)\n\n- **Burst**: 15 requests per 10 seconds per IP\n- **Sustained**: 60 requests per minute per IP\n- **Protection**: Prevents abuse while allowing normal usage\n\n---\n\n## 🔐 Security Features\n\n- ✅ **Rate limiting** - Two-tier protection (burst + sustained)\n- ✅ **CORS headers** - Configurable origin restrictions\n- ✅ **WAF protection** - Cloudflare Web Application Firewall\n- ✅ **HTTPS only** - TLS 1.3 encryption\n- ✅ **DDoS protection** - Cloudflare automatic mitigation\n- ✅ **Input validation** - Query parameter sanitization\n\n---\n\n## 📊 SEO \u0026 UX Features\n\n- ✅ **Dark mode** - Automatic system preference detection\n- ✅ **Social sharing** - Twitter, LinkedIn, Reddit, Discord, Copy link\n- ✅ **Mobile responsive** - Optimized for all screen sizes\n- ✅ **Example queries** - Pre-filled search suggestions\n- ✅ **Source attribution** - Links back to wiki pages\n- ✅ **Meta tags** - Complete SEO optimization\n- ✅ **Favicons** - Branded with main site assets\n- ✅ **Loading states** - Clear user feedback\n\n---\n\n---\n\n**Project**: [SQLite MCP Server](https://github.com/neverinfamous/sqlite-mcp-server)\n**Worker Repository**: [wiki-search-worker](https://github.com/neverinfamous/wiki-search-worker)\n**Production URL**: https://search.adamic.tech\n**Technology**: Cloudflare Workers + AI Search (formerly AutoRAG)\n**CI/CD**: GitHub Actions\n**Security**: Dependabot + Rate Limiting + WAF\n**Maintained by**: [@neverinfamous](https://github.com/neverinfamous)\n**Organization**: [Adamic](https://adamic.tech)\n**License**: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverinfamous%2Fwiki-search-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneverinfamous%2Fwiki-search-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverinfamous%2Fwiki-search-worker/lists"}