Ragex
Hybrid Retrieval-Augmented Generation for Multi-Language Codebases
is an MCP (Model Context Protocol) server that analyzes codebases using compiler output and language-native tools to build a knowledge graph, enabling natural-language querying of code structure, relationships and semantics.
It combines an ETS-backed knowledge graph (AST-derived modules, functions, calls and dependencies) with a local embeddings model (Bumblebee,
sentence-transformers/all-MiniLM-L6-v2
) for semantic search, then fuses both through hybrid retrieval (Reciprocal Rank Fusion, semantic-first or graph-first strategies). On top of that sit graph algorithms (PageRank, betweenness/closeness centrality, Louvain community detection), dead-code and duplication detection, dependency/coupling analysis, and semantic refactoring tools (rename, extract, inline, change signature) that update call sites via the graph.
Ragex natively analyzes Elixir and Erlang (native AST parsers) plus Python, Ruby, JavaScript and TypeScript, and optionally persists its graph, embeddings and MetaAST cache in dllb for per-project storage across restarts.
Usage
Prerequisites
Elixir 1.18+ and Erlang/OTP 27+; Python 3.x and Node.js are optional, for Python and JavaScript analysis.
Build
git clone https://github.com/Oeditus/ragex.git
cd ragex
mix deps.get
mix compile
Run as an MCP server
bin/ragex-mcp
# Auto-analyze a project on startup
bin/ragex-mcp --project /path/to/your/project