JIDRA - Backend de Contexto Java para LLMs
akhilsinghcodes/jidra
Indexação de grafos Java com redução de 87-95% em tokens para LLM
Ver no GitHubServidor MCP que indexa grafos de chamadas em codebases Java, valida contra beans Spring em tempo de execução, e gera contexto estruturado e mínimo para análise por LLMs. Reduz tokens em 87-95% mantendo cobertura total da lógica de negócio.
Instalação
npx convez-ai akhilsinghcodes/jidra1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Análise de codebase Java com Claude mantendo context reduzido
- Rastreamento de fluxos de chamadas e dependências em projetos Spring Boot
- Diagnóstico de erros em lógica de negócio complexa com IA
Veredito

JIDRA é uma solução robusta para times que trabalham com codebases Java grandes e precisam economizar tokens ao usar LLMs para análise. A validação contra Spring Actuator e a redução comprovada de contexto (87-95%) o tornam production-ready, mas exige conhecimento técnico de Java, Spring e Docker para máximo aproveitamento.
README
A tradução para o português deste README ainda está na fila.
JIDRA: Enterprise Java Context Backend for LLM Workflows
JIDRA reduces LLM token costs by 87-95% while maintaining 100% business logic coverage.
Overview
JIDRA is a structured context backend that extracts Java call graphs, validates them against runtime Spring beans, and generates minimal, noise-free context for LLM analysis.
Real Results
Traditional Approach: 10,811 input tokens (raw source)
JIDRA Approach: 869 input tokens (structured graph)
Result: ✅ 95.9% reduction + equal output quality
Key Features
- ✅ Static Java Call Graph Extraction - AST-based parsing
- ✅ Spring Actuator Validation - Remove 71-78% phantom edges with runtime bean confirmation
- ✅ 87-95% Token Reduction - Proven on real Claude API calls
- ✅ Zero False Negatives - 100% business logic coverage
- ✅ Docker Integration - Auto-managed Spring Boot validation
- ✅ Interactive Visualization - Vis.js-based graph explorer
- ✅ MCP Integration - Direct Claude integration via tools
Quick Start
Installation
# Clone repository
git clone https://github.com/akhilsinghcodes/jidra.git
cd jidra
# Install dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e .
Basic Usage
# Index a Java codebase
jidra index --codebase /path/to/java/project --output ./results
# Validate with Spring Actuator
jidra validate --codebase /path/to/java/project --port 8080
# Generate minimal context for LLM
jidra context --graph results/graph.jsonl --method "com.example.MyClass#method"
# Visualize the call graph
jidra graph-view --graph results/graph.jsonl --output graph.html
Architecture
Core Components
| Module | Purpose |
|---|---|
extractor.py | Java AST parsing (38 KB) |
cli.py | Command-line interface (66 KB) |
actuator_client.py | Docker + Spring Actuator integration |
graph_validator.py | Spring bean validation |
flow_stitcher.py | Recursive business flow extraction |
graph_visualizer.py | Interactive HTML visualization |
mcp_server.py | Claude MCP server |
llm_client.py | LiteLLM integration |
Data Flow
Java repo
↓
Extraction (AST parsing)
↓
graph.jsonl (static call graph)
↓
Spring Actuator Validation (Docker)
↓
graph_validated.jsonl (71-78% cleaner)
↓
Context Generation
↓
87-95% smaller context for LLM
CLI Commands
jidra index
Build a static call graph from Java source.
jidra index --codebase /path/to/repo --output ./results
Output:
graph.jsonl- Full call graphgraph_test.jsonl- Test code graph
jidra validate
Validate graph against Spring Actuator beans (requires Docker).
jidra validate --codebase /path/to/repo --port 8080 --timeout 300
Output:
graph_validated.jsonl- Filtered, verified graphvalidation_report.json- Metrics and statistics
jidra context
Extract minimal method context for LLM analysis.
jidra context --graph graph.jsonl --method "com.example.MyClass#myMethod" --max-chars 5000
jidra flow
Trace and extract business flow.
jidra flow --graph graph.jsonl --method "com.example.MyClass#myMethod" --depth 3
jidra graph-view
Generate interactive visualization.
jidra graph-view --graph graph.jsonl --output graph.html
MCP Integration (Claude)
Use JIDRA with Claude via Model Context Protocol:
# MCP tools available
- jidra_get_method_context # Get local method scope
- jidra_get_flow # Get full stitched flow
- jidra_get_agent_flow # Get compact agent view
- jidra_get_method_source # Retrieve source code
- jidra_get_call_chain # Find paths between methods
Configuration
Edit src/jidra/config.yaml:
llm_profiles:
default:
provider: litellm
model: claude-opus-4-7
max_tokens: 4096
temperature: 0.7
Project Structure
jidra/
├── src/jidra/ # Main package
│ ├── models.py # Data models
│ ├── cli.py # CLI interface
│ ├── engine.py # Reasoning backend
│ ├── extractor.py # Java parser
│ ├── graph_validator.py # Validation
│ ├── actuator_client.py # Docker integration
│ └── ... (18 more modules)
├── tests/ # Test suite
├── docs/ # Documentation
├── examples/ # Usage examples
├── .github/workflows/ # CI/CD
├── setup.py # Package metadata
├── requirements.txt # Dependencies
├── README.md # This file
├── LICENSE # MIT License
└── .gitignore # Git ignore
Requirements
- Python: 3.9+
- Java: 11+ (for parsing)
- Docker: Required for Spring Actuator validation
- Dependencies: See
requirements.txt
Use Cases
1. Cost Reduction
# Reduce LLM token usage by 87-95%
# Example: 1,000 methods/month
# Traditional: $15/month → JIDRA: $0.15/month
2. LLM-Powered Code Analysis
# Generate graph
jidra index --codebase .
# Extract context
jidra context --graph graph.jsonl --method "Controller#handler"
# Feed to Claude for analysis
3. Enterprise Validation
# Ensure graph matches runtime
jidra validate --codebase . --port 8080
# Result: Only real, confirmed bean calls remain
Proven Results
Token Reduction (Real Claude API)
| Project | Type | Traditional | Graph | Reduction |
|---|---|---|---|---|
| search | Proprietary | 10,811 | 869 | 95.9% |
| Spring Petclinic | Public | 2,736-5,304 | 320-383 | 87.4% |
Safety Metrics
- Business Logic Coverage: 100% (all business calls captured)
- False Negatives: 0% (no missing logic)
- False Positives Removed: 71-78% (via Spring Actuator)
- Output Quality: Identical across approaches
Installation
From Source
git clone https://github.com/your-username/jidra.git
cd jidra
pip install -e .
From PyPI
pip install jidra
Testing
# Run test suite
pytest tests/
# Run with coverage
pytest --cov=src/jidra tests/
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -am 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - See LICENSE file for details.
Support
Citation
If you use JIDRA in your research or production systems, please cite:
@software{jidra2026,
title = {JIDRA: Enterprise Java Context Backend for LLM Workflows},
author = {JIDRA Contributors},
year = {2026},
url = {https://github.com/your-username/jidra}
}
JIDRA: Reduce LLM token costs by 87-95%. Production-ready. Open-source.