{"id":39853744,"url":"https://github.com/stepandel/chatbot-with-memory","last_synced_at":"2026-01-18T13:47:27.860Z","repository":{"id":329508754,"uuid":"1026296968","full_name":"stepandel/chatbot-with-memory","owner":"stepandel","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-20T02:29:34.000Z","size":361,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-22T11:50:36.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://chatbot-with-memory.vercel.app","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/stepandel.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-25T16:32:43.000Z","updated_at":"2025-12-20T02:29:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/stepandel/chatbot-with-memory","commit_stats":null,"previous_names":["stepandel/chatbot-with-memory"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/stepandel/chatbot-with-memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepandel%2Fchatbot-with-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepandel%2Fchatbot-with-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepandel%2Fchatbot-with-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepandel%2Fchatbot-with-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stepandel","download_url":"https://codeload.github.com/stepandel/chatbot-with-memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepandel%2Fchatbot-with-memory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-18T13:47:27.387Z","updated_at":"2026-01-18T13:47:27.844Z","avatar_url":"https://github.com/stepandel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Chat App\n\nA dual-mode AI chat application with collective and personal experiences, featuring markdown rendering, conversation management, and seamless authentication.\n\n## 🎯 Two Distinct Experiences\n\n### 🎉 Fun Mode\n- **Collective AI Experience**: Everyone shares the same conversation memory\n- **No Sign-in Required**: Instant access for experimentation\n- **Shared Knowledge**: AI learns from all user interactions\n- **Perfect for**: Discovery, learning, and collaborative conversations\n\n### 🔒 Personal Mode  \n- **Private AI Assistant**: Personal conversation history and memory\n- **Google Authentication**: Secure, private access\n- **Chat Management**: Save, organize, and revisit conversations\n- **Perfect for**: Personal projects, private assistance, and individual workflows\n\n## ✨ Features\n\n- 🤖 **AI Chat**: Powered by OpenAI GPT-4o with streaming responses\n- 📝 **Markdown Support**: Rich text rendering with syntax highlighting\n- 💬 **Conversation Management**: Save, title, and organize chat history (Personal Mode)\n- 📱 **Mobile-Responsive**: Collapsible sidebar and touch-optimized interface\n- ⌨️ **Enhanced Input**: Auto-expanding textarea with Shift+Enter for new lines\n- 🧠 **Vector Memory**: Pinecone for intelligent context retrieval\n- 🔐 **Dual Authentication**: Fun Mode (instant) + Google OAuth (personal)\n- 🎨 **Clean UI**: Minimalist design with grey color scheme\n\n## 🛠 Tech Stack\n\n- **Frontend**: Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS\n- **UI Components**: Custom components with shadcn/ui patterns\n- **Backend**: Next.js API Routes, NextAuth.js v4\n- **Database**: PostgreSQL with Prisma ORM\n- **Vector DB**: Pinecone for semantic search\n- **AI**: OpenAI GPT-4o + text-embedding-3-small\n- **Markdown**: react-markdown with syntax highlighting\n- **Authentication**: NextAuth.js with Google Provider + Custom Fun Mode\n\n## 🚀 Quick Start\n\n### 1. Clone and Install\n\n```bash\ngit clone \u003cyour-repo\u003e\ncd chat-app\npnpm install\n```\n\n### 2. Environment Setup\n\nCopy `.env.example` to `.env.local` and configure:\n\n```bash\n# Database\nDATABASE_URL=\"postgresql://chat_user:chat_password@localhost:5432/chat_app_db\"\n\n# NextAuth\nNEXTAUTH_SECRET=\"your-secret-here\"  # Generate: openssl rand -base64 32\nNEXTAUTH_URL=\"http://localhost:3000\"\n\n# Google OAuth (for Personal Mode)\nGOOGLE_CLIENT_ID=\"your-google-client-id\"\nGOOGLE_CLIENT_SECRET=\"your-google-client-secret\"\n\n# AI Services\nOPENAI_API_KEY=\"your-openai-api-key\"\nPINECONE_API_KEY=\"your-pinecone-api-key\"\nPINECONE_INDEX=\"your-pinecone-index-name\"\n```\n\n### 3. Start Database\n\n```bash\n# Start PostgreSQL with Docker\ndocker-compose up -d postgres\n\n# Run database migrations\npnpm db:migrate\n```\n\n### 4. Run Development Server\n\n```bash\npnpm dev\n```\n\nVisit [http://localhost:3000](http://localhost:3000)\n\n## 🏗 Project Structure\n\n```\nsrc/\n├── app/                    # Next.js App Router pages\n│   ├── page.tsx           # Home page (Fun Mode + Auth selection)\n│   ├── app/page.tsx       # Personal Mode chat interface\n│   └── api/               # API routes\n├── components/            # React components\n│   ├── chat-interface.tsx         # Fun Mode chat\n│   ├── personal-chat-interface.tsx # Personal Mode chat\n│   ├── chat-sidebar.tsx           # Conversation sidebar\n│   ├── markdown-message.tsx       # Message rendering\n│   └── ui/                        # Base UI components\n├── hooks/                 # Custom React hooks\n│   └── useConversations.ts        # Conversation management\n├── lib/                   # Utilities and configurations\n│   ├── auth.ts            # NextAuth configuration\n│   ├── openai.ts          # OpenAI client\n│   ├── pinecone.ts        # Pinecone client\n│   └── conversation-title-generator.ts # AI title generation\n└── prisma/               # Database schema and migrations\n```\n\n## 🎮 Usage\n\n### Fun Mode\n1. Visit homepage\n2. Click \"Fun Mode\" button\n3. Start chatting immediately\n4. Access shared AI memory and conversations\n\n### Personal Mode\n1. Visit homepage  \n2. Click \"Sign in with Google\"\n3. Create and manage private conversations\n4. Use sidebar to navigate chat history\n5. Enjoy personalized AI assistance\n\n### Chat Features\n- **Markdown Rendering**: AI responses support full markdown\n- **Expandable Input**: Textarea grows with content\n- **Keyboard Shortcuts**: Enter to send, Shift+Enter for new line\n- **Mobile Support**: Collapsible sidebar with overlay\n\n## 🗃 Database Management\n\n### Prisma Commands\n\n```bash\n# Generate Prisma client\npnpm db:generate\n\n# Run migrations\npnpm db:migrate\n\n# View database in browser\npnpm db:studio\n\n# Reset database\npnpm db:reset\n```\n\n### pgAdmin (Optional)\n\nAccess pgAdmin at [http://localhost:8080](http://localhost:8080)\n- **Email**: `admin@chatapp.com`\n- **Password**: `admin123`\n\n## 🔧 Development\n\n### Key Features Implementation\n\n- **Dual Mode Architecture**: Separate authentication flows and data isolation\n- **AI Title Generation**: Automatic conversation naming based on content\n- **Markdown Rendering**: Syntax highlighting and rich text display\n- **Responsive Design**: Mobile-first with collapsible navigation\n- **Vector Search**: Semantic conversation history retrieval\n\n### Database Schema\n\nThe app uses Prisma with PostgreSQL:\n- **Users**: Authentication and profile data\n- **Conversations**: Chat sessions (Personal Mode only)  \n- **Messages**: Individual chat messages\n\n### Adding Features\n\n1. **New UI Components**: Add to `src/components/ui/`\n2. **API Endpoints**: Create in `src/app/api/`\n3. **Database Changes**: Update `prisma/schema.prisma` and migrate\n4. **Authentication**: Modify `src/lib/auth.ts`\n\n## 🚀 Production Deployment\n\n### Environment Checklist\n- [ ] Configure production database URL\n- [ ] Set secure `NEXTAUTH_SECRET`\n- [ ] Update `NEXTAUTH_URL` to production domain\n- [ ] Configure Google OAuth for production domain\n- [ ] Set up Pinecone production index\n- [ ] Verify OpenAI API key limits\n\n### Recommended Stack\n- **Hosting**: Vercel, Netlify, or similar\n- **Database**: Railway, Supabase, or managed PostgreSQL\n- **Vector DB**: Pinecone (production tier)\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**Database Connection**\n```bash\n# Check PostgreSQL status\ndocker-compose ps\ndocker-compose logs postgres\n```\n\n**Build Errors**\n```bash\n# Clear Next.js cache\npnpm clean\npnpm build\n```\n\n**Authentication Issues**\n- Verify Google OAuth credentials\n- Check `NEXTAUTH_URL` matches your domain\n- Ensure `NEXTAUTH_SECRET` is set\n\n**Vector Search Not Working**\n- Verify Pinecone API key and index name\n- Check Pinecone index dimensions (1536 for text-embedding-3-small)\n\n## 📄 License\n\nMIT License - see LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepandel%2Fchatbot-with-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepandel%2Fchatbot-with-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepandel%2Fchatbot-with-memory/lists"}