Web Search API for AI Agents
Semantic search, web crawling, and AI-powered answers - built for the next generation of AI applications
Features β’ Quick Start β’ API β’ SDK β’ Dashboard β’ Docs
|
Meaning-based search powered by Google's text-embedding-004 model |
Playwright-based crawler with full JavaScript rendering |
Clean text & markdown extraction with Trafilatura |
|
Generate answers with citations using Gemini 2.5 Flash |
Multi-source research reports with key points synthesis |
Find semantically similar web pages using vector similarity |
| Requirement | Version |
|---|---|
| Python | 3.11+ |
| PostgreSQL | 14+ with pgvector |
| Redis | 6+ (optional) |
# 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-- Create database and enable pgvector
CREATE DATABASE gexa;
\c gexa
CREATE EXTENSION vector;# Copy environment template
cp .env.example .env
# Edit .env with your configuration
# Required: GEMINI_API_KEY, DATABASE_URL# 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--reloadflag due to Playwright subprocess compatibility
| 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 |
Once running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Dashboard: http://localhost:8000/dashboard/
Install the SDK:
pip install gexa-py # Coming soon to PyPI
# Or install from source:
pip install -e sdk/pythonfrom 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"
)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)GEXA includes a modern web dashboard for testing and API key management.
Access at: http://localhost:8000/dashboard/
- π§ͺ 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
| Component | Technology |
|---|---|
| Framework | FastAPI |
| Database | PostgreSQL + pgvector |
| LLM | Google Gemini 2.5 Flash |
| Embeddings | Google text-embedding-004 |
| Crawler | Playwright (Chromium) |
| Content Extraction | Trafilatura |
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
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
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