{"id":29028446,"url":"https://github.com/divak-ar/searchagent","last_synced_at":"2026-04-10T02:43:19.306Z","repository":{"id":300797760,"uuid":"1007081832","full_name":"Divak-ar/searchAgent","owner":"Divak-ar","description":"A chat app with web search functionality and some more features (look the README.MD file)","archived":false,"fork":false,"pushed_at":"2025-06-23T16:35:41.000Z","size":390,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-23T17:42:36.217Z","etag":null,"topics":["flask","gemini-api","langchain","langgraph","nextjs","python","server-sent-events","tailwindcss","tavily-api","typescript","uvicorn","web-development"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Divak-ar.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}},"created_at":"2025-06-23T12:40:42.000Z","updated_at":"2025-06-23T16:35:44.000Z","dependencies_parsed_at":"2025-06-23T17:43:48.155Z","dependency_job_id":"4004a653-6e23-419e-9987-6769b391e5fe","html_url":"https://github.com/Divak-ar/searchAgent","commit_stats":null,"previous_names":["divak-ar/searchagent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Divak-ar/searchAgent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Divak-ar%2FsearchAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Divak-ar%2FsearchAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Divak-ar%2FsearchAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Divak-ar%2FsearchAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Divak-ar","download_url":"https://codeload.github.com/Divak-ar/searchAgent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Divak-ar%2FsearchAgent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018885,"owners_count":23245627,"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":["flask","gemini-api","langchain","langgraph","nextjs","python","server-sent-events","tailwindcss","tavily-api","typescript","uvicorn","web-development"],"created_at":"2025-06-26T07:11:31.310Z","updated_at":"2026-04-10T02:43:19.279Z","avatar_url":"https://github.com/Divak-ar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search Agent - AI-Powered Web Search Assistant\r\n\r\nA modern, responsive AI-powered search application that combines web search capabilities with conversational AI to provide comprehensive answers to user queries.\r\n\r\n## ✨ Features\r\n\r\n- 🔍 **Intelligent Web Search**: Uses Tavily API for real-time web search\r\n- 🤖 **AI-Powered Responses**: Powered by Google Gemini 2.0 Flash model\r\n- 💬 **Real-time Streaming**: Server-sent events for live response streaming\r\n- 🎯 **Search Progress Tracking**: Visual indicators for search stages\r\n- 📋 **Copy Functionality**: Easy copy-to-clipboard for AI responses\r\n- 🔄 **Session Management**: Start fresh conversations anytime\r\n- 🎨 **Session Context**: Custom prompt engineering for personalized AI responses\r\n- 💡 **Interactive UI**: Modern design with smooth animations\r\n\r\n## 📸 Screenshots\r\n\r\n### Main Application Interface\r\n![Search Agent Main Interface](screenshot/image.png)\r\n*The main chat interface showing real-time AI responses with web search integration*\r\n\r\n### Custom Session Context\r\n![Custom Session Context](screenshot/custom_prompt.png)\r\n*Session Context feature allowing users to customize AI behavior with predefined presets or custom prompts*\r\n\r\n## 🏗️ Architecture\r\n\r\n### Backend (Python/FastAPI)\r\n\r\n- **FastAPI**: Modern web framework for building APIs\r\n- **LangGraph**: State management for AI workflows\r\n- **LangChain**: Integration with various AI models and tools\r\n- **Tavily**: Web search API for real-time information retrieval\r\n- **Google Gemini**: Advanced language model for responses\r\n\r\n### Frontend (Next.js/React)\r\n\r\n- **Next.js 15**: React framework with TypeScript\r\n- **Tailwind CSS**: Utility-first CSS framework for responsive design\r\n- **Server-Sent Events**: Real-time communication with backend\r\n- **TypeScript**: Type-safe development\r\n\r\n## 🚀 Setup Instructions\r\n\r\n### Prerequisites\r\n\r\n- Python 3.8+\r\n- Node.js 18+\r\n- API Keys for:\r\n  - Google Gemini API\r\n  - Tavily Search API\r\n\r\n### Backend Setup\r\n\r\n1. Navigate to the server directory:\r\n\r\n   ```bash\r\n   cd server\r\n   ```\r\n\r\n2. Create and activate a virtual environment:\r\n\r\n   ```bash\r\n   # Windows\r\n   python -m venv venv\r\n   venv\\Scripts\\activate\r\n\r\n   # macOS/Linux\r\n   python -m venv venv\r\n   source venv/bin/activate\r\n   ```\r\n\r\n   ```bash\r\n   python -m venv venv\r\n   venv\\Scripts\\activate  # Windows\r\n   # or\r\n   source venv/bin/activate  # Linux/Mac\r\n   ```\r\n\r\n3. Install dependencies:\r\n\r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n\r\n4. Configure environment variables in `.env`:\r\n\r\n   ```env\r\n   GOOGLE_API_KEY=your_google_api_key_here\r\n   TAVILY_API_KEY=your_tavily_api_key_here\r\n\r\n   # Optional: LangSmith for debugging\r\n   LANGSMITH_TRACING=true\r\n   LANGSMITH_ENDPOINT=\"https://api.smith.langchain.com\"\r\n   LANGSMITH_API_KEY=your_langsmith_key\r\n   LANGSMITH_PROJECT=your_project_name\r\n   ```\r\n\r\n5. Start the backend server:\r\n   ```bash\r\n   uvicorn app:app --reload --host 0.0.0.0 --port 8000\r\n   ```\r\n\r\n### Frontend Setup\r\n\r\n1. Navigate to the client directory:\r\n\r\n   ```bash\r\n   cd client\r\n   ```\r\n\r\n2. Install dependencies:\r\n\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n3. Start the development server:\r\n   ```bash\r\n   npm run dev\r\n   ```\r\n\r\nThe application will be available at:\r\n\r\n- Frontend: http://localhost:3000 (or next available port)\r\n- Backend: http://localhost:8000\r\n- Backend Health Check: http://localhost:8000/health\r\n\r\n## Usage\r\n\r\n1. Open the frontend application in your browser\r\n2. Type your question in the input field\r\n3. Watch as the AI searches the web and compiles a response\r\n4. Copy responses using the copy button\r\n\r\n### Navigation\r\n\r\n- **Home Tab**: Welcome page with project overview and \"Perplexity 2.0\" branding\r\n- **Chat Tab**: Main conversational interface with AI search capabilities\r\n- **Settings Tab**: Customize your experience (theme, search preferences, etc.)\r\n\r\n### Session Context Feature\r\n\r\n1. Click the large **Session Context** button (bottom-right corner)\r\n2. Choose from **Quick Presets**:\r\n   - General Assistant\r\n   - Technical Expert\r\n   - Research Assistant\r\n   - Simple Explainer\r\n3. Or write your own **Custom Context** to guide AI responses\r\n4. The context applies to all messages in the current session\r\n\r\n### Chat Features\r\n\r\n1. **Ask Questions**: Type your question in the input field\r\n2. **Real-time Responses**: Watch as the AI searches the web and streams responses\r\n3. **Search Progress**: Visual indicators show search stages (searching → reading → writing)\r\n4. **Copy Responses**: Click the copy button on any AI response\r\n\r\n### Tips for Better Results\r\n\r\n- Use the **Session Context** to specify your role or expertise level\r\n- Ask specific questions for more targeted search results\r\n- Try different contexts for the same question to get varied perspectives\r\n\r\n## Development\r\n\r\n### Adding New Features\r\n\r\n1. **Backend**: Add new endpoints in `app.py` or extend the LangGraph workflow\r\n2. **Frontend**: Add new components in `src/components/` or extend existing functionality\r\n\r\n### Environment Variables\r\n\r\nThe application uses several environment variables:\r\n\r\n- `GOOGLE_API_KEY`: Required for AI responses\r\n- `TAVILY_API_KEY`: Required for web search\r\n- `LANGSMITH_*`: Optional for debugging and monitoring\r\n\r\n### Performance Tips\r\n\r\n- Use specific, focused queries for better search results\r\n- Set appropriate session context to reduce token usage\r\n- Monitor API usage in Google AI Studio and Tavily dashboards\r\n\r\n\r\n### Building for Production\r\n\r\n1. **Backend Deployment**:\r\n\r\n   ```bash\r\n   # Install production dependencies\r\n   pip install gunicorn\r\n\r\n   # Run with gunicorn\r\n   gunicorn app:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000\r\n   ```\r\n\r\n2. **Frontend Build**:\r\n\r\n   ```bash\r\n   cd client\r\n   npm run build\r\n   npm start\r\n   ```\r\n\r\n3. **Environment Variables**: Set production API keys and endpoints\r\n4. **Security**: Configure CORS, rate limiting, and authentication as needed\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Test thoroughly\r\n5. Submit a pull request\r\n\r\n## License\r\n\r\nThis project is for educational and development purposes.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivak-ar%2Fsearchagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivak-ar%2Fsearchagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivak-ar%2Fsearchagent/lists"}