{"id":14968806,"url":"https://github.com/supabase/headless-vector-search","last_synced_at":"2025-04-24T00:23:47.554Z","repository":{"id":169460372,"uuid":"645423151","full_name":"supabase/headless-vector-search","owner":"supabase","description":"Supabase Toolkit to perform vector similarity search on your knowledge base embeddings.","archived":false,"fork":false,"pushed_at":"2024-05-15T18:37:54.000Z","size":16,"stargazers_count":171,"open_issues_count":3,"forks_count":31,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-11T21:21:27.912Z","etag":null,"topics":["embeddings","openai","postgres","postgresql","supabase","vector"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["supabase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-05-25T16:04:03.000Z","updated_at":"2025-04-03T23:54:02.000Z","dependencies_parsed_at":"2024-11-06T14:36:35.476Z","dependency_job_id":null,"html_url":"https://github.com/supabase/headless-vector-search","commit_stats":{"total_commits":13,"total_committers":4,"mean_commits":3.25,"dds":0.3076923076923077,"last_synced_commit":"a68de46917aeec4dfb41b4e853a40f08712301ac"},"previous_names":["supabase-community/headless-vector-search","supabase-community/headless-supabase-vector-search"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fheadless-vector-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fheadless-vector-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fheadless-vector-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase%2Fheadless-vector-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase","download_url":"https://codeload.github.com/supabase/headless-vector-search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249229684,"owners_count":21234114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["embeddings","openai","postgres","postgresql","supabase","vector"],"created_at":"2024-09-24T13:40:36.102Z","updated_at":"2025-04-24T00:23:47.508Z","avatar_url":"https://github.com/supabase.png","language":"TypeScript","funding_links":["https://github.com/sponsors/supabase"],"categories":[],"sub_categories":[],"readme":"## Headless Vector Search\n\nProvides a vector/similarity search for any documentation site. It's [headless](https://en.wikipedia.org/wiki/Headless_software), so that you can integrate it into your existing website.\n\n#### How it works:\n\n- This repo initializes a new `docs` schema inside your database.\n- The accompanying [GitHub Action](https://github.com/supabase/supabase-vector-embeddings-github-action) ingests your markdown docs into your database as embeddings.\n- This repo provides an Edge Function that handles user queries, converting them into ChatGPT-like responses.\n\n#### Tech stack:\n\n- Supabase: Database \u0026 Edge Functions.\n- OpenAI: Embeddings and completions.\n- GitHub Actions: for ingesting your markdown docs.\n\n## Set-up\n\nStart by creating a new Supabase Project: [database.new](https://database.new).\n\n1. Clone this repo \n2. Link the repo to your remote project: `supabase link --project-ref XXX`\n3. Apply the database migrations: `supabase db push`\n4. Set your OpenAI key as a secret: `supabase secrets set OPENAI_API_KEY=sk-xxx`\n5. Deploy the Edge Functions: `supabase functions deploy --no-verify-jwt`\n6. Expose `docs` schema via API in Supabase Dashboard [settings](https://app.supabase.com/project/_/settings/api) \u003e `API Settings` \u003e `Exposed schemas`\n7. [Setup](https://github.com/supabase/supabase-vector-embeddings-github-action#use) `supabase-vector-embeddings` GitHub action in your Knowledge Base repo. You will see the embeddings populated in your database after the GitHub Action has run.\n\n## Usage\n\n1. Find the URL for the `vector-search` Edge Function in the [Functions section](https://app.supabase.com/project/_/functions) of the Dashboard.\n2. Inside your appliction, you can send the user queries to this endpoint to receive a streamed response from OpenAI.\n\n\u003cdetails\u003e\n \u003csummary\u003eSee cURL example\u003c/summary\u003e\n\n```bash\n curl -i --location --request GET 'https://your-project-ref.functions.supabase.co/vector-search?query=What%27s+Supabase%3F'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n \u003csummary\u003eSee \u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/API/EventSource\"\u003eEventSource\u003c/a\u003e example\u003c/summary\u003e\n\n\n```ts\nconst onSubmit = (e: Event) =\u003e {\n  e.preventDefault()\n  answer.value = \"\"\n  isLoading.value = true\n\n  const query = new URLSearchParams({ query: inputRef.current!.value })\n  const projectUrl = `https://your-project-ref.functions.supabase.co`\n  const queryURL = `${projectURL}/${query}`\n  const eventSource = new EventSource(queryURL)\n\n  eventSource.addEventListener(\"error\", (err) =\u003e {\n    isLoading.value = false\n    console.error(err)\n  })\n  \n  eventSource.addEventListener(\"message\", (e: MessageEvent) =\u003e {\n    isLoading.value = false\n\n    if (e.data === \"[DONE]\") {\n      eventSource.close()\n      return\n    }\n\n    const completionResponse: CreateCompletionResponse = JSON.parse(e.data)\n    const text = completionResponse.choices[0].text\n\n    answer.value += text\n  });\n\n  isLoading.value = true\n}\n```\n\n\u003c/details\u003e\n\n\n## Showcase\n\n- [docs.supabase.com](https://supabase.com/docs) - Use \u003ckbd\u003ecmd+k\u003c/kbd\u003e to access.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fheadless-vector-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase%2Fheadless-vector-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase%2Fheadless-vector-search/lists"}