Skip to content

mrkeshav-05/AiSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 AiSearch

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.

AiSearch Architecture TypeScript Docker License

✨ Features

  • πŸ” 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

πŸš€ Quick Start

One-Command Setup

# 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

Manual Setup

# 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 dev

πŸ—οΈ Architecture

AiSearch 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

πŸ› οΈ Technology Stack

Backend

  • 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

Frontend

  • 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

Infrastructure

  • Containerization: Docker with multi-stage builds
  • Orchestration: Docker Compose
  • Package Management: pnpm workspaces
  • Development: Hot reload and instant feedback

πŸ“Š System Components

AI Agents

  • 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

External Services

  • SearXNG: Privacy-focused meta-search engine
  • Google Gemini: Advanced AI language model
  • OpenAI GPT: Alternative AI model support

πŸ”§ Configuration

Environment Variables

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:3000

Frontend 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

πŸš€ Deployment

Docker Deployment (Recommended)

# Production deployment
./scripts/start.sh --docker

# Or manually with Docker Compose
docker compose -f docker-compose.prod.yml up --build

Manual Production Deployment

# Build for production
./scripts/build.sh

# Start production servers
./scripts/start.sh --prod

πŸ§ͺ Testing

# 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

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“‹ Available Scripts

Automation Scripts

  • ./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

Package Scripts

  • pnpm dev - Start development servers
  • pnpm build - Build for production
  • pnpm test - Run test suites
  • pnpm lint - Lint all packages
  • pnpm clean - Clean build artifacts

🌐 URLs

When running locally:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Built with ❀️ for the future of search

About

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.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors