{"id":29093198,"url":"https://github.com/michaelsolati/tldr-wikipedia","last_synced_at":"2025-06-28T08:07:08.891Z","repository":{"id":298872977,"uuid":"934539334","full_name":"MichaelSolati/tldr-wikipedia","owner":"MichaelSolati","description":"Talk to any Wikipedia article!  - A LiveKit tech demo.","archived":false,"fork":false,"pushed_at":"2025-02-18T02:42:04.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T11:03:03.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MichaelSolati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-02-18T02:13:28.000Z","updated_at":"2025-02-18T02:42:07.000Z","dependencies_parsed_at":"2025-06-13T11:03:07.283Z","dependency_job_id":"1fcfb747-186f-4376-aadd-4c7588295675","html_url":"https://github.com/MichaelSolati/tldr-wikipedia","commit_stats":null,"previous_names":["michaelsolati/tldr-wikipedia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MichaelSolati/tldr-wikipedia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSolati%2Ftldr-wikipedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSolati%2Ftldr-wikipedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSolati%2Ftldr-wikipedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSolati%2Ftldr-wikipedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelSolati","download_url":"https://codeload.github.com/MichaelSolati/tldr-wikipedia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelSolati%2Ftldr-wikipedia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262396498,"owners_count":23304445,"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":[],"created_at":"2025-06-28T08:07:06.146Z","updated_at":"2025-06-28T08:07:08.885Z","avatar_url":"https://github.com/MichaelSolati.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tldr Wikipedia\n\nThis is a demo project to show how to use LiveKit with the `livekit-client` and `@livekit/agents` JS libraries.\n\nThis demo is broken into two parts:\n\n- A Chrome extension that adds a button to any Wikipedia page that allows you to start a LiveKit room to ask questions about the page.\n- An express server that generates tokens and initializes an agent and a room with the information from the Wikipedia page to answer questions about.\n\n## Running the demo\n\n### Chrome extension\n\nBuild the Chrome extension by running:\n\n```bash\ncd extension\nnpm install\nnpm run build\n```\n\nThen load the unpacked extension in Chrome by going to `chrome://extensions`, enabling developer mode, and selecting the `dist` folder.\n\nBy default the extension will use the `localhost` server. To use a different server, set the `tokenUrl` param in `extension/src/environment.ts` to the URL of the server you want to use.\n\n### Server\n\nFirst copy `server/.env.example` to `server/.env.local` and update the values to match your LiveKit project, add your OpenAI API key to the `OPENAI_API_KEY`, and set `MODE` to `dev`.\n\nThen run the server:\n\n```bash\ncd server\nnpm install\nnpm run build\nnpm run start\n```\n\nThe server will be running on `http://localhost:8080`.\n\n### Wikipedia\n\nGo to any Wikipedia article and click the button in the bottom right corner to start a LiveKit room and ask any questions about the page.\n\n## How does it work?\n\nThe Chrome extension uses the `livekit-client` library to connect to the LiveKit room created by the express server. That process begins by sending the URL of the Wikipedia page to the server, which then uses the `livekit-server-sdk` library to generate an access token a user can use to connect to a room as well as creating a room with the URL of the Wikipedia page sent by the extension. (See `server/src/api/token.ts`)\n\nThe server also runs the `@livekit/agents` CLI which is where we define the agent that will answer questions about the Wikipedia page. The agent is defined in `server/src/agents.ts` and basically does two things:\n\n1. It takes the Wikipedia URL that `server/src/api/token.ts` used to create the room and uses scrapes all the content from the page, filtering out superflous content on the page in order to minimize how much data we send to OpenAI. This is done in the `getContentFromUrl` function.\n2. We start a session with our agent and a specific prompt that asks the agent to answer questions about the Wikipedia page.\n\nAnd that's it! The agent will now be able to answer questions about the Wikipedia page in the LiveKit room created by the extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelsolati%2Ftldr-wikipedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelsolati%2Ftldr-wikipedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelsolati%2Ftldr-wikipedia/lists"}