{"id":34612959,"url":"https://github.com/cometchat/ai-agent-vercel-examples","last_synced_at":"2026-05-29T09:31:56.826Z","repository":{"id":319283674,"uuid":"1077375356","full_name":"cometchat/ai-agent-vercel-examples","owner":"cometchat","description":"Starter templates to accelerate AI agent development on CometChat.","archived":false,"fork":false,"pushed_at":"2025-10-17T12:23:36.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T03:06:35.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/cometchat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T07:03:40.000Z","updated_at":"2025-10-17T12:23:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"69af21dc-2dba-443b-985d-dab2e7565005","html_url":"https://github.com/cometchat/ai-agent-vercel-examples","commit_stats":null,"previous_names":["cometchat/ai-agent-vercel-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cometchat/ai-agent-vercel-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometchat%2Fai-agent-vercel-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometchat%2Fai-agent-vercel-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometchat%2Fai-agent-vercel-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometchat%2Fai-agent-vercel-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometchat","download_url":"https://codeload.github.com/cometchat/ai-agent-vercel-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometchat%2Fai-agent-vercel-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33646421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":[],"created_at":"2025-12-24T14:18:00.497Z","updated_at":"2026-05-29T09:31:56.811Z","avatar_url":"https://github.com/cometchat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vercel AI SDK Agent Examples\n\nThe repository hosts two Express applications that showcase how to stand up tool-enabled agents and connect them to CometChat or any other SSE-capable client.\n\n- `vercel-knowledge-agent` — Knowledge-base grounded assistant with ingestion, search, and an SSE `/agent` endpoint.\n- `product-hunt-agent` — Product Hunt launch assistant that surfaces top posts, Algolia search results, and celebration actions.\n\nBoth services share the same Express + Jade skeleton, exposing REST APIs under `/api` and a CometChat-compatible agent stream under `/agent`.\n\n## Prerequisites\n\n- Node.js 18 or newer (Node 20 recommended)\n- `OPENAI_API_KEY` with access to GPT-4o or compatible models\n- Optional: `PRODUCTHUNT_API_TOKEN` (needed for Product Hunt GraphQL calls)\n\nClone the repository:\n\n```bash\ngit clone https://github.com/cometchat/ai-agent-vercel-examples.git\n```\n\n## Directory Overview\n\n| Folder | Description |\n| --- | --- |\n| `vercel-knowledge-agent/agent` | Knowledge agent API + SSE endpoint with ingestion and search workflows. |\n| `vercel-knowledge-agent/web` | Static demo page that can be wired to CometChat. |\n| `product-hunt-agent/agent` | Product Hunt agent API + SSE endpoint, ported from `product-hunt-agent`. |\n| `product-hunt-agent/web` | Product Hunt mock landing page with CometChat embed and API helpers. |\n\n## Quick Start\n\nEach service is self-contained. From the repository root run the following for the agent you want to test.\n\n### Knowledge Agent\n\n```bash\ncd vercel-knowledge-agent/agent\nnpm install\nOPENAI_API_KEY=sk-... npm start\n```\n\nKey endpoints:\n- `POST /api/tools/ingest` — Ingest markdown, text, URLs, or file uploads.\n- `POST /api/tools/searchDocs` — Retrieve citations from the knowledge base.\n- `POST /api/agents/knowledge/generate` — Non-streaming chat responses.\n- `POST /agent` — Server-sent-event stream compatible with the CometChat adapter.\n\n### Product Hunt Agent\n\n```bash\ncd product-hunt-agent/agent\nnpm install\nOPENAI_API_KEY=sk-... PRODUCTHUNT_API_TOKEN=phc-... npm start\n```\n\nKey endpoints:\n- `GET /api/top`, `/api/top-week`, `/api/top-range` — Product Hunt GraphQL lookups.\n- `GET /api/search` — Product Hunt Algolia search.\n- `POST /api/chat` — Non-streaming chat interface.\n- `POST /agent` — SSE stream mirroring the Knowledge Agent contract.\n\n## Testing the `/agent` Stream\n\nUse `curl -N` (or any SSE client) to watch streaming output:\n\n```bash\ncurl -N http://localhost:3000/agent \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"messages\": [\n          { \"role\": \"user\", \"content\": \"Show the top Product Hunt launches today.\" }\n        ]\n      }'\n```\n\nYou should see incremental JSON events (text deltas, tool calls/results) identical to the Vercel knowledge agent demo.\n\n## CometChat Integration\n\nBoth `/web` directories contain static pages with the CometChat Chat Embed widget. Set `COMETCHAT_USER_UID` (and optionally tweak agent IDs or variants) to test the end-to-end experience:\n\n```html\n\u003cscript defer src=\"https://cdn.jsdelivr.net/npm/@cometchat/chat-embed@1.x.x/dist/main.js\"\u003e\u003c/script\u003e\n```\n\nThe widgets point to the SSE `/agent` routes provided by these services.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometchat%2Fai-agent-vercel-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometchat%2Fai-agent-vercel-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometchat%2Fai-agent-vercel-examples/lists"}