Skip to content

CodeGovindz/GEXA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GEXA

πŸ” GEXA

Web Search API for AI Agents
Semantic search, web crawling, and AI-powered answers - built for the next generation of AI applications

Build Status Python FastAPI PostgreSQL License

Features β€’ Quick Start β€’ API β€’ SDK β€’ Dashboard β€’ Docs


✨ Features

πŸ” Semantic Search

Meaning-based search powered by Google's text-embedding-004 model

πŸ•·οΈ Web Crawling

Playwright-based crawler with full JavaScript rendering

πŸ“„ Content Extraction

Clean text & markdown extraction with Trafilatura

πŸ€– AI Answers

Generate answers with citations using Gemini 2.5 Flash

πŸ“Š Deep Research

Multi-source research reports with key points synthesis

πŸ”— Similar Pages

Find semantically similar web pages using vector similarity


πŸš€ Quick Start

Prerequisites

Requirement Version
Python 3.11+
PostgreSQL 14+ with pgvector
Redis 6+ (optional)

Installation

# Clone the repository
git clone https://github.com/CodeGovindz/GEXA.git
cd GEXA

# Create virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
# source venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -e ".[dev]"

# Install Playwright browsers
playwright install chromium

Database Setup

-- Create database and enable pgvector
CREATE DATABASE gexa;
\c gexa
CREATE EXTENSION vector;

Configuration

# Copy environment template
cp .env.example .env

# Edit .env with your configuration
# Required: GEMINI_API_KEY, DATABASE_URL

Run the Server

# Apply database migrations
alembic upgrade head

# Start the API server
$env:PYTHONPATH="src"  # Windows PowerShell
uvicorn gexa.main:app --host 127.0.0.1 --port 8000

⚠️ Windows Note: Don't use --reload flag due to Playwright subprocess compatibility


πŸ“‘ API Endpoints

Endpoint Method Description
/search POST πŸ” Semantic web search with embeddings
/contents POST πŸ“„ Crawl & extract content from URLs
/crawl POST πŸ•·οΈ Background site crawling
/findsimilar POST πŸ”— Find semantically similar pages
/answer POST πŸ€– AI answers with citations
/research POST πŸ“Š In-depth research reports
/keys GET/POST/DELETE πŸ”‘ API key management

API Documentation

Once running, visit:


🐍 Python SDK

Install the SDK:

pip install gexa-py  # Coming soon to PyPI
# Or install from source:
pip install -e sdk/python

Usage

from gexa_py import Gexa

# Initialize client
gexa = Gexa("your-api-key", base_url="http://localhost:8000")

# πŸ” Semantic Search
results = gexa.search("latest AI research papers", num_results=10)

# πŸ“„ Get Content from URLs
content = gexa.get_contents(["https://example.com"])

# πŸ”— Find Similar Pages
similar = gexa.find_similar("https://openai.com")

# πŸ€– Get AI Answer
answer = gexa.answer("What is transformer architecture?")

# πŸ“Š Deep Research
research = gexa.research(
    topic="Benefits of machine learning in healthcare",
    depth="deep"
)

Async Support

from gexa_py import AsyncGexa

async def main():
    async with AsyncGexa("your-api-key") as gexa:
        results = await gexa.search("async search query")
        print(results)

🎨 Dashboard

GEXA includes a modern web dashboard for testing and API key management.

Access at: http://localhost:8000/dashboard/

Features

  • πŸ§ͺ Playground - Test all API endpoints interactively
  • πŸ”‘ API Keys - Create, copy, and delete API keys
  • πŸ“Š Usage - Monitor API usage (coming soon)
  • πŸ“š Docs - Quick reference and links

πŸ› οΈ Tech Stack

FastAPI PostgreSQL Playwright Gemini

Component Technology
Framework FastAPI
Database PostgreSQL + pgvector
LLM Google Gemini 2.5 Flash
Embeddings Google text-embedding-004
Crawler Playwright (Chromium)
Content Extraction Trafilatura

πŸ“ Project Structure

GEXA/
β”œβ”€β”€ src/gexa/           # Core API source code
β”‚   β”œβ”€β”€ api/            # FastAPI routes
β”‚   β”œβ”€β”€ crawler/        # Web crawling engine
β”‚   β”œβ”€β”€ search/         # Vector search & embeddings
β”‚   └── database/       # Models & schemas
β”œβ”€β”€ sdk/python/         # Python SDK
β”œβ”€β”€ dashboard/          # Web dashboard UI
β”œβ”€β”€ alembic/            # Database migrations
└── tests/              # Test suite

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

πŸ“„ License

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


Made with ❀️ by CodeGovindz

⭐ Star this repo β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature

About

πŸ” GEXA - Web Search API for AI Agents. Semantic search, web crawling, content extraction & AI-powered answers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors