AI-Powered Search Engine with Real-Time Conversations
AiSearch is a modern, intelligent search platform that combines the power of traditional search engines with advanced AI capabilities. Get instant, contextual answers with real-time streaming responses and comprehensive source citations.
- π Intelligent Search: AI-powered search with contextual understanding
- π¬ Real-Time Chat: WebSocket-based streaming responses
- π Source Citations: Comprehensive source tracking and display
- π― Focus Modes: Specialized search for web, academic, images, videos, and more
- π Privacy-First: Built on SearXNG for anonymous search
- π± Responsive Design: Works seamlessly on desktop and mobile
- π³ Production Ready: Full Docker containerization and deployment
# Clone the repository
git clone https://github.com/mrkeshav-05/AiSearch.git
cd AiSearch
# Start in development mode
./scripts/start.sh
# Or start in production mode
./scripts/start.sh --prod
# Or start with Docker
./scripts/start.sh --docker# Install dependencies
pnpm install
# Set up environment variables
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
# Build shared package
pnpm run build:shared
# Start development servers
pnpm run devAiSearch follows a monorepo architecture with clear separation of concerns:
βββ backend/ # Node.js/Express API server
β βββ src/
β β βββ api/v1/ # RESTful API endpoints
β β βββ services/ # Business logic layer
β β β βββ ai/ # AI agents and models
β β β βββ external/ # External service integrations
β β βββ config/ # Configuration management
β β βββ types/ # Backend-specific types
β βββ tests/ # Backend tests
βββ frontend/ # Next.js React application
β βββ src/
β β βββ app/ # Next.js 13+ app directory
β β βββ components/ # React components
β β βββ hooks/ # Custom React hooks
β β βββ types/ # Frontend-specific types
β βββ tests/ # Frontend tests
βββ shared/ # Common types and utilities
β βββ src/
β βββ types/ # Shared TypeScript types
β βββ constants/ # Application constants
βββ scripts/ # Automation scripts
β βββ build.sh # Build automation
β βββ start.sh # Start automation (multi-mode)
β βββ stop.sh # Clean shutdown
βββ infrastructure/ # Docker and deployment
βββ docs/ # Comprehensive documentation
- Runtime: Node.js with TypeScript
- Framework: Express.js with layered architecture
- AI Integration: Google Gemini AI, OpenAI GPT
- Search Engine: SearXNG integration
- Real-Time: WebSocket connections
- Testing: Jest with comprehensive test coverage
- Framework: Next.js 14+ with App Router
- Language: TypeScript with strict type checking
- Styling: Tailwind CSS with responsive design
- Components: Custom UI components with shadcn/ui
- State Management: React hooks and context
- Build Tool: Turbopack for fast development
- Containerization: Docker with multi-stage builds
- Orchestration: Docker Compose
- Package Management: pnpm workspaces
- Development: Hot reload and instant feedback
- Web Search Agent: General web search with AI summaries
- Academic Search Agent: Scholarly article search and analysis
- Image Search Agent: Visual content discovery
- Video Search Agent: Multimedia content search
- Writing Assistant: Content generation and editing
- SearXNG: Privacy-focused meta-search engine
- Google Gemini: Advanced AI language model
- OpenAI GPT: Alternative AI model support
Backend Configuration (backend/.env):
# AI API Keys
GOOGLE_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
# External Services
SEARXNG_API_URL=http://localhost:4000
# Server Configuration
PORT=8000
NODE_ENV=development
# CORS and Security
CORS_ORIGIN=http://localhost:3000Frontend Configuration (frontend/.env.local):
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_WS_URL=ws://localhost:8000
# Build Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000# Production deployment
./scripts/start.sh --docker
# Or manually with Docker Compose
docker compose -f docker-compose.prod.yml up --build# Build for production
./scripts/build.sh
# Start production servers
./scripts/start.sh --prod# Run all tests
pnpm test
# Backend tests only
pnpm run test:backend
# Frontend tests only
pnpm run test:frontend
# Test coverage
pnpm run test:coverage- Development Setup - Detailed setup instructions
- Architecture Guide - System architecture deep dive
- API Documentation - RESTful API reference
- Docker Guide - Container deployment
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
./scripts/start.sh- Start application (development mode)./scripts/start.sh --prod- Start in production mode./scripts/start.sh --docker- Start with Docker containers./scripts/stop.sh- Clean shutdown of all services./scripts/build.sh- Build entire application
pnpm dev- Start development serverspnpm build- Build for productionpnpm test- Run test suitespnpm lint- Lint all packagespnpm clean- Clean build artifacts
When running locally:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- SearXNG: http://localhost:4000
- Health Check: http://localhost:8000/api/v1/health
This project is licensed under the MIT License - see the LICENSE file for details.
- SearXNG for privacy-focused search
- Google Gemini for AI capabilities
- Next.js for the amazing React framework
- Tailwind CSS for utility-first styling
Built with β€οΈ for the future of search