Skip to content

coder-deep-singh/Seagoat

Repository files navigation

SeaGOAT

SeaGOAT is an advanced codebase analysis and search tool designed for Git repositories. It creates vector embeddings of your code, enabling fast, context-aware, and semantic code search. SeaGOAT provides both a server and a command-line interface (CLI) for querying your codebase, making it easier to find functions, classes, or code snippets using natural language, keywords, or regular expressions.

Features

  • Codebase Analysis: Analyzes your Git repository and builds vector embeddings for efficient search.
  • Semantic Search: Query your codebase using keywords, regex, or natural language descriptions.
  • Context-Aware Results: Retrieve results with configurable lines of context above and below each match.
  • Generative Enhancements: Optionally use generative models to enhance search results.
  • Server-Client Architecture: Run a local server to analyze and serve queries; interact via CLI or HTTP API.
  • Performance Testing: Includes Locust-based load testing scripts.
  • Extensive Test Suite: Comprehensive tests for server, CLI, and core modules.

Installation

SeaGOAT uses Poetry for dependency management and virtual environments.

# Clone the repository
git clone <this-repo-url>
cd Seagoat

# Install dependencies
poetry install

# Activate the virtual environment
poetry shell

Usage

1. Start the Server

The server must be started in the root of your Git repository:

poetry run python -m seagoat.server start <path-to-your-git-repo>

2. Query the Codebase

You can use the CLI to query your codebase:

poetry run python -m seagoat.cli "your search query" <path-to-your-git-repo>

CLI Options

  • --max-results/-l: Limit the number of results
  • --context-above/-B and --context-below/-A: Lines of context
  • --context/-C: Context above and below
  • --generative/-g: Use generative model for enhanced results
  • --reverse/-r: Reverse result order

3. API Endpoints

  • POST /lines/query: Query lines in the codebase
  • POST /files/query: Query files
  • GET /status: Server status and analysis progress

4. Load Testing

Use Locust to simulate load:

poetry run locust -f locustfile.py --host=http://localhost:<port>

Testing

Run the test suite using pytest:

poetry run pytest

The tests/ directory contains comprehensive tests for server, CLI, configuration, and core logic.

Demo

See the docs/ folder for demo GIFs:

  • demo.gif, demo-slideshow.gif, describe_what_you_are_looking_for.gif, etc.

SeaGOAT: Semantic code search for your Git repositories.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages