grepai  by yoanbernabeu

Semantic code search and call graph analysis for AI agents

Created 2 weeks ago

New!

819 stars

Top 43.4% on SourcePulse

GitHubView on GitHub
Project Summary

grepai is a CLI-native tool that provides semantic code search and call graph analysis, designed to offer privacy-first, high-quality context to AI coding assistants. It addresses the limitations of traditional text-based search by indexing code meaning via vector embeddings, enabling natural language queries to find conceptually related code, thereby improving AI agent efficiency and developer productivity.

How It Works

grepai indexes code semantics using vector embeddings, allowing users to query codebases with natural language descriptions of functionality, rather than relying on exact keywords or regex patterns. It also analyzes code structure to generate call graphs, identifying function callers and callees. This approach yields more relevant results than traditional search tools, providing richer context for AI agents and simplifying complex code exploration.

Quick Start & Requirements

  • Install: Execute curl -sSL https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.sh | sh or download from releases.
  • Run: Initialize with grepai init, start indexing with grepai watch, search semantically with grepai search "query", or trace call graphs with grepai trace callers "function".
  • Prerequisites: An embedding provider is required (Ollama, LM Studio, or OpenAI API key). Go 1.22+ is needed only for building from source. Full documentation is available.

Highlighted Details

  • AI Agent Integration: Natively integrates with popular AI coding assistants like Cursor, Windsurf, Claude Code, Gemini CLI, and OpenAI Codex via grepai agent-setup.
  • MCP Server Mode: Can run as a Model Context Protocol (MCP) server, exposing grepai_search, grepai_trace_callers, etc., as native tools for AI agents.
  • Search Boost: Automatically prioritizes or de-prioritizes search results based on file paths (e.g., favoring source files over test files), configurable via .grepai/config.yaml.
  • Hybrid Search: Optionally combines vector similarity search with traditional text matching using Reciprocal Rank Fusion for enhanced relevance, especially for queries containing exact identifiers.

Maintenance & Community

The project appears actively maintained, with a self-update mechanism (grepai update) fetching the latest releases from GitHub. No specific community channels (like Discord/Slack) or notable contributors are mentioned in the provided README.

Licensing & Compatibility

The project is released under the MIT License, which is permissive and generally compatible with commercial use and closed-source linking.

Limitations & Caveats

grepai is a CLI-native tool, which may present a learning curve for users unfamiliar with command-line interfaces. The "fast" trace mode relies on regex, potentially offering less precision than the "precise" (tree-sitter) mode. The effectiveness of semantic search is dependent on the chosen embedding model and its quality.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
42
Issues (30d)
34
Star History
884 stars in the last 18 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.4%
17k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 3 days ago
Feedback? Help us improve.