{"id":27150024,"url":"https://github.com/braindead-dev/ask-pg","last_synced_at":"2025-10-15T05:54:22.536Z","repository":{"id":285019095,"uuid":"947625443","full_name":"braindead-dev/ask-pg","owner":"braindead-dev","description":"Chat with an AI version of Paul Graham, with the context of his 200+ essays","archived":false,"fork":false,"pushed_at":"2025-03-28T23:30:14.000Z","size":5384,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T00:26:29.131Z","etag":null,"topics":["openai","paul-graham","ycombinator"],"latest_commit_sha":null,"homepage":"https://paulgraham.chat","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/braindead-dev.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}},"created_at":"2025-03-13T01:42:52.000Z","updated_at":"2025-03-28T23:30:18.000Z","dependencies_parsed_at":"2025-03-29T00:36:34.545Z","dependency_job_id":null,"html_url":"https://github.com/braindead-dev/ask-pg","commit_stats":null,"previous_names":["braindead-dev/ask-pg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braindead-dev%2Fask-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braindead-dev%2Fask-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braindead-dev%2Fask-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braindead-dev%2Fask-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braindead-dev","download_url":"https://codeload.github.com/braindead-dev/ask-pg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247852605,"owners_count":21006975,"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":["openai","paul-graham","ycombinator"],"created_at":"2025-04-08T13:37:45.216Z","updated_at":"2025-10-15T05:54:17.489Z","avatar_url":"https://github.com/braindead-dev.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://paulgraham.chat/pgroid.png\" alt=\"PG Chat Logo\" width=\"200\"/\u003e\n  \u003ch1\u003eChat with AI PG\u003c/h1\u003e\n\u003c/div\u003e\nAn AI-powered chat application that lets you interact with a virtual Paul Graham, trained on his essays. Get insights, advice, and perspectives in PG's characteristic direct and concise style.\n\n## 🌟 Features\n\n- Chat interface with AI Paul Graham\n- Trained on PG's essays for authentic responses\n- Real-time streaming responses\n- Modern, responsive UI built with Next.js and Tailwind CSS\n- Vector-based semantic search through PG's essays\n- Server-sent events for smooth chat experience\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- npm or yarn\n- A Vercel KV database instance\n- An OpenAI API key\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/yourusername/ask-pg.git\ncd ask-pg\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n# or\nyarn install\n```\n\n3. Set up environment variables by creating a `.env` file in the root directory:\n\n```env\nOPENAI_API_KEY=your_openai_api_key_here\nKV_URL=your_vercel_kv_url_here\nKV_REST_API_READ_ONLY_TOKEN=your_kv_readonly_token_here\nKV_REST_API_URL=your_kv_rest_api_url_here\n```\n\n4. Set up the vector store by going to [OpenAI's vector store page](https://platform.openai.com/api-keys) and creating a new vector store, and uploading the essays in /public/essays. Then, get the vector store ID and update the `vectorStoreId` in `config/ai.ts`.\n\n5. Run the development server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\n6. Open [http://localhost:3000](http://localhost:3000) in your browser to start chatting!\n\n## 🔧 Configuration\n\n### AI Configuration (`config/ai.ts`)\n\nThe `config/ai.ts` file contains important settings for the AI chat functionality:\n\n- `model`: Specifies the OpenAI model to use (default: \"gpt-4o-mini\")\n- `defaultSystemPrompt`: The system prompt that defines PG's personality and behavior\n- `fileSearch`: Configuration for the vector store search\n  - `vectorStoreId`: ID for the vector store containing PG's essays\n  - `maxResults`: Maximum number of essay results to return per search\n- `storeResponse`: Whether to store generated responses for later retrieval\n\n### Environment Variables\n\n- `OPENAI_API_KEY`: Your OpenAI API key for accessing the GPT models\n- `KV_URL`: Vercel KV database URL for storing chat data\n- `KV_REST_API_READ_ONLY_TOKEN`: Read-only token for KV REST API access\n- `KV_REST_API_URL`: URL for the KV REST API endpoint\n\n### Vector Store Setup\n\nBefore the application can function properly, you'll need to:\n\n1. Upload Paul Graham's essays to OpenAI's vector storage\n2. Get your vector store ID from OpenAI\n3. Update the `vectorStoreId` in `config/ai.ts` with your vector store ID\n\nWithout this setup, the semantic search functionality that helps the AI reference PG's essays will not work.\n\n## 🛠️ Tech Stack\n\n- [Next.js](https://nextjs.org/) - React framework\n- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS\n- [OpenAI API](https://openai.com/) - AI model integration\n- [Vercel KV](https://vercel.com/storage/kv) - Key-value storage\n- [Radix UI](https://www.radix-ui.com/) - Headless UI components\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## ⭐️ Support\n\nIf you find this project helpful, please consider giving it a star on GitHub!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraindead-dev%2Fask-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraindead-dev%2Fask-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraindead-dev%2Fask-pg/lists"}