Skip to content

AyushKr2003/sage_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SageSearch Logo

SageSearch

Intelligent web search and information synthesis platform

Features β€’ Demo β€’ Installation β€’ Usage β€’ Architecture β€’ Contributing β€’ License

GitHub stars GitHub forks GitHub issues License

πŸ“‹ Overview

SageSearch is a sophisticated search platform built with Flutter and FastAPI that transforms how users discover information online. It intelligently retrieves, analyzes, and synthesizes content from multiple web sources, delivering comprehensive AI-enhanced responses to user queries while maintaining source attribution.

SageSearch in action - Intelligent search results with source attribution

✨ Features

Frontend

  • 🎯 Intuitive Interface - Clean, modern UI with focus on content and readability
  • πŸ“± Fully Responsive - Seamless experience across desktop, tablet, and mobile devices
  • πŸ’‘ Smart Suggestions - Contextual search suggestions and history tracking
  • 🎨 Customizable Theme - Dark mode support with elegant color scheme
  • ⚑ Performance Optimized - Fast loading times and smooth animations

Backend

  • πŸ” Intelligent Web Search - Leverages Tavily API for accurate and relevant search results
  • 🧠 Smart Source Ranking - Uses sentence transformers to prioritize the most relevant sources
  • πŸ€– AI-Powered Responses - Generates comprehensive answers using Google Gemini
  • πŸ”„ Real-time Communication - WebSocket support for streaming responses
  • 🌐 RESTful API - Clean and well-documented endpoints for easy integration

🎬 Demo

Home Page

SageSearch Home Page

Loading Page

SageSearch Loading Page

Result Page

SageSearch Result Page

πŸš€ Getting Started

Prerequisites

Frontend

  • Flutter SDK (latest version)
  • Dart SDK (latest version)
  • A code editor (VS Code, Android Studio, or IntelliJ IDEA)

Backend

Installation

Frontend

  1. Clone the repository

    git clone https://github.com/AyushKr2003/sage_search.git
    cd sage_search
  2. Install dependencies

    cd frontend
    flutter pub get
  3. Environment Setup

    Create a .env file in the frontend directory based on the provided example:

    copy .env.example .env

    Then update the values in .env with your configuration:

    BACKEND_URL='ws://localhost:8000/ws/chats'
    
  4. Run the application

    flutter run

Backend

  1. Navigate to the backend directory

    cd backend
  2. Set up the environment

    # Create and activate virtual environment
    python -m venv venv
    .\venv\Scripts\activate
    
    # Install dependencies
    pip install -r requirements.txt
    
    # Configure environment variables
    copy .env.example .env

    Edit the .env file with your API keys:

    TAVILY_API_KEY=your_tavily_api_key
    GEMINI_API_KEY=your_gemini_api_key
    
  3. Run the server

    # Development mode with auto-reload
    uvicorn main:app --reload
    
    # Production mode
    uvicorn main:app --host 0.0.0.0 --port 8000

    The server will be available at http://localhost:8000

πŸ“– Usage

SageSearch provides an intuitive interface for searching and discovering information:

  1. Enter your query in the search bar
  2. Review the AI-synthesized answer with highlighted sources
  3. Explore related topics through suggested searches
  4. Toggle between light and dark themes based on your preference

πŸ—οΈ Architecture

Project Structure

sage_search/

β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constant/
β”‚   β”‚   └── const.dart               # Application constants and configuration
β”‚   β”œβ”€β”€ pages/ 
β”‚   β”‚   └── home_page.dart           # Main application interface
β”‚   β”œβ”€β”€ theme/ 
β”‚   β”‚   └── colors.dart              # Theme definitions and styling
β”‚   β”œβ”€β”€ widgets/     
β”‚   β”‚   β”œβ”€β”€ custome_list.dart        # Reusable list component
β”‚   β”‚   β”œβ”€β”€ search_section.dart      # Search interface component
β”‚   β”‚   β”œβ”€β”€ side_bar.dart            # Navigation sidebar
β”‚   β”‚   β”œβ”€β”€ side_bar_button.dart     # Interactive sidebar elements
β”‚   β”‚   └── top_bar.dart             # Application header component
β”‚   β”œβ”€β”€ services/                    
β”‚   β”‚   └── web_socket_service.dart  # API and data services
β”‚   └──  main.dart                   # Application entry point
β”‚
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ main.py                      # FastAPI application and endpoints
β”‚   β”œβ”€β”€ config.py                    # Configuration settings
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ search_service.py        # Tavily API integration
β”‚   β”‚   β”œβ”€β”€ sort_sorce_service.py    # Source ranking
β”‚   β”‚   └── llm_service.py           # Gemini AI integration
β”‚   β”œβ”€β”€ pydantic_model/
β”‚   β”‚   └── chat_body.py             # Request/Response models
β”‚   β”œβ”€β”€ tests/                       # Unit and integration tests
β”‚   └── requirements.txt             # Project dependencies

API Reference

REST Endpoints

POST /chats

Request body:

{
  "query": "What are the latest developments in quantum computing?"
}

WebSocket

Connect to /ws/chats to receive streaming responses.

Example client usage:

const ws = new WebSocket('ws://localhost:8000/ws/chats');
ws.onopen = () => {
  ws.send(JSON.stringify({ query: "What are the latest developments in quantum computing?" }));
};
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data);
};

🀝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit your Changes (git commit -m 'Add some amazing feature')
  4. Push to the Branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See the open issues for a list of proposed features and known issues.

πŸ“„ License

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

πŸ‘ Acknowledgments

Frontend

Backend

Team


Built with ❀️ by Ayush Kumar Singh

About

Intelligent web search and information synthesis platform built with Flutter and FastAPI, powered by Gemini AI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors