{"id":16555064,"url":"https://github.com/jimmylv/chatvox","last_synced_at":"2025-09-13T06:37:04.844Z","repository":{"id":153207077,"uuid":"628496590","full_name":"JimmyLv/ChatVox","owner":"JimmyLv","description":"\"Chat With Any Video\" project in 24 hours, challenge myself to complete in @Supabase's AI Hackathon.","archived":false,"fork":false,"pushed_at":"2024-06-02T04:39:50.000Z","size":1931,"stargazers_count":101,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-10T21:36:48.500Z","etag":null,"topics":["ai","chatgpt","openai","supabase","video","whisper"],"latest_commit_sha":null,"homepage":"https://chatvox.aitodo.co","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JimmyLv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-04-16T05:54:19.000Z","updated_at":"2025-04-10T11:43:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"93a9d62b-1698-43ca-b93e-f49bedc58442","html_url":"https://github.com/JimmyLv/ChatVox","commit_stats":{"total_commits":89,"total_committers":1,"mean_commits":89.0,"dds":0.0,"last_synced_commit":"f7dfa0e54c91e7d2d2cecf286c2253f98520d0ed"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JimmyLv/ChatVox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyLv%2FChatVox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyLv%2FChatVox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyLv%2FChatVox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyLv%2FChatVox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimmyLv","download_url":"https://codeload.github.com/JimmyLv/ChatVox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimmyLv%2FChatVox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274929107,"owners_count":25375708,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","chatgpt","openai","supabase","video","whisper"],"created_at":"2024-10-11T19:52:59.215Z","updated_at":"2025-09-13T06:37:04.804Z","avatar_url":"https://github.com/JimmyLv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatVox - \"Chat With Any Video\"\n\n\u003e based on Supabase's [Next.js OpenAI Doc Search Starter](https://github.com/supabase-community/nextjs-openai-doc-search?og=v2)\n\n![ChatVox Cover Image](/public/og-image.png)\n\nChatVox · Chat With Any Video: This project takes the YouTube/Podcast link you enter or the local Video/Audio file (WIP) you upload on the page, then you can chat with the video, just like ChatGPT! 🤩\n\nTalking to a video is essentially talking to this person, It meant \"chat with wisdom\" 🤣\n\nI'm updating AI Hackathon on Twitter in real-time, This is the showcase of the whole process. https://twitter.com/Jimmy_JingLv/status/1647483720608415744?s=20\n\nThe technology behind it is to process them to use as the custom context within [OpenAI Text Completion](https://platform.openai.com/docs/guides/completion) prompts and LangChain to handle the document searching and Q\u0026A answering.\n\n## Deploy\n\nDeploy this starter to Vercel. The Supabase integration will automatically set the required environment variables and configure your [Database Schema](./supabase/migrations/20230406025118_init.sql). All you have to do is set your `OPENAI_API_KEY` and you're ready to go!\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?demo-title=Next.js%20OpenAI%20Doc%20Search%20Starter\u0026demo-description=Template%20for%20building%20your%20own%20custom%20ChatGPT%20style%20doc%20search%20powered%20by%20Next.js%2C%20OpenAI%2C%20and%20Supabase.\u0026demo-url=https%3A%2F%2Fsupabase.com%2Fdocs\u0026demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1OntM6THNEUvlUsYy6Bjmf%2F475e39dbc84779538c8ed47c63a37e0e%2Fnextjs_openai_doc_search_og.png\u0026project-name=Next.js%20OpenAI%20Doc%20Search%20Starter\u0026repository-name=nextjs-openai-doc-search-starter\u0026repository-url=https%3A%2F%2Fgithub.com%2FJimmyLv%2FChatVox%2F\u0026from=github\u0026integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv\u0026env=OPENAI_API_KEY\u0026envDescription=Get%20your%20OpenAI%20API%20key%3A\u0026envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys\u0026teamCreateStatus=hidden\u0026external-id=nextjs-open-ai-doc-search)\n\n## Technical Details\n\nBuilding your own custom ChatGPT involves four steps:\n\n1. [👷 Build time] Pre-process the knowledge base (your `.mdx` files in your `pages` folder).\n2. [👷 Build time] Store embeddings in Postgres with [pgvector](https://supabase.com/docs/guides/database/extensions/pgvector).\n3. [🏃 Runtime] Perform vector similarity search to find the content that's relevant to the question.\n4. [🏃 Runtime] Inject content into OpenAI GPT-3 text completion prompt and stream response to the client.\n\n## 👷 Build time\n\nStep 1. and 2. happen at build time, e.g. when Vercel builds your Next.js app. During this time the [`generate-embeddings`](./lib/generate-embeddings.ts) script is being executed which performs the following tasks:\n\n```mermaid\nsequenceDiagram\n    participant Vercel\n    participant DB (pgvector)\n    participant OpenAI (API)\n    loop 1. Pre-process the knowledge base\n        Vercel-\u003e\u003eVercel: Chunk .mdx pages into sections\n        loop 2. Create \u0026 store embeddings\n            Vercel-\u003e\u003eOpenAI (API): create embedding for page section\n            OpenAI (API)-\u003e\u003eVercel: embedding vector(1536)\n            Vercel-\u003e\u003eDB (pgvector): store embedding for page section\n        end\n    end\n```\n\nIn addition to storing the embeddings, this script generates a checksum for each of your `.mdx` files and stores this in another database table to make sure the embeddings are only regenerated when the file has changed.\n\n## 🏃 Runtime\n\nStep 3. and 4. happen at runtime, anytime the user submits a question. When this happens, the following sequence of tasks is performed:\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Edge Function\n    participant DB (pgvector)\n    participant OpenAI (API)\n    Client-\u003e\u003eEdge Function: { query: lorem ispum }\n    critical 3. Perform vector similarity search\n        Edge Function-\u003e\u003eOpenAI (API): create embedding for query\n        OpenAI (API)-\u003e\u003eEdge Function: embedding vector(1536)\n        Edge Function-\u003e\u003eDB (pgvector): vector similarity search\n        DB (pgvector)-\u003e\u003eEdge Function: relevant docs content\n    end\n    critical 4. Inject content into prompt\n        Edge Function-\u003e\u003eOpenAI (API): completion request prompt: query + relevant docs content\n        OpenAI (API)--\u003e\u003eClient: text/event-stream: completions response\n    end\n```\n\nThe relevant files for this are the [`SearchDialog` (Client)](./components/SearchDialog.tsx) component and the [`vector-search` (Edge Function)](./pages/api/vector-search.ts).\n\nThe initialization of the database, including the setup of the `pgvector` extension is stored in the [`supabase/migrations` folder](./supabase/migrations/) which is automatically applied to your local Postgres instance when running `supabase start`.\n\n## Local Development\n\n### Configuration\n\n- `cp .env.example .env`\n- Set your `OPENAI_API_KEY` in the newly created `.env` file.\n\n### Start Supabase\n\nMake sure you have Docker installed and running locally. Then run\n\n```bash\nsupabase start\n```\n\n### Start the Next.js App\n\nIn a new terminal window, run\n\n```bash\npnpm dev\n```\n\n## Deploy\n\nDeploy this starter to Vercel. The Supabase integration will automatically set the required environment variables and configure your [Database Schema](./supabase/migrations/20230406025118_init.sql). All you have to do is set your `OPENAI_API_KEY` and you're ready to go!\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?demo-title=Next.js%20OpenAI%20Doc%20Search%20Starter\u0026demo-description=Template%20for%20building%20your%20own%20custom%20ChatGPT%20style%20doc%20search%20powered%20by%20Next.js%2C%20OpenAI%2C%20and%20Supabase.\u0026demo-url=https%3A%2F%2Fsupabase.com%2Fdocs\u0026demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1OntM6THNEUvlUsYy6Bjmf%2F475e39dbc84779538c8ed47c63a37e0e%2Fnextjs_openai_doc_search_og.png\u0026project-name=Next.js%20OpenAI%20Doc%20Search%20Starter\u0026repository-name=nextjs-openai-doc-search-starter\u0026repository-url=https%3A%2F%2Fgithub.com%2Fsupabase-community%2Fnextjs-openai-doc-search%2F\u0026from=github\u0026integration-ids=oac_jUduyjQgOyzev1fjrW83NYOv\u0026env=OPENAI_API_KEY\u0026envDescription=Get%20your%20OpenAI%20API%20key%3A\u0026envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys\u0026teamCreateStatus=hidden\u0026external-id=nextjs-open-ai-doc-search)\n\n## Learn More\n\n- Read the blogpost on how we built [ChatGPT for the Supabase Docs](https://supabase.com/blog/chatgpt-supabase-docs).\n- [[Docs] pgvector: Embeddings and vector similarity](https://supabase.com/docs/guides/database/extensions/pgvector)\n- Watch [Greg's](https://twitter.com/ggrdson) \"How I built this\" [video](https://youtu.be/Yhtjd7yGGGA) on the [Rabbit Hole Syndrome YouTube Channel](https://www.youtube.com/@RabbitHoleSyndrome):\n\n[![Video: How I Built Supabase’s OpenAI Doc Search](https://img.youtube.com/vi/Yhtjd7yGGGA/0.jpg)](https://www.youtube.com/watch?v=Yhtjd7yGGGA)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmylv%2Fchatvox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmylv%2Fchatvox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmylv%2Fchatvox/lists"}