| description | AI-powered codebase optimisation with language-specific best practices and interactive approval. |
|---|
Code-Graph-RAG provides AI-powered codebase optimisation with best practices guidance and an interactive approval workflow.
cgr optimize python --repo-path /path/to/your/repoGuide the optimisation process using your own coding standards:
cgr optimize python \
--repo-path /path/to/your/repo \
--reference-document /path/to/best_practices.mdcgr optimize java \
--reference-document ./ARCHITECTURE.mdcgr optimize rust \
--reference-document ./docs/performance_guide.mdThe agent incorporates guidance from your reference documents when suggesting optimisations, ensuring they align with your project's standards and architectural decisions.
cgr optimize javascript \
--repo-path /path/to/frontend \
--orchestrator google:gemini-2.0-flash-thinking-exp-01-21cgr optimize javascript --repo-path /path/to/frontend \
--batch-size 5000All supported languages: python, javascript, typescript, rust, go, java, scala, c, cpp
- Analysis Phase: The agent analyses your codebase structure using the knowledge graph
- Pattern Recognition: Identifies common anti-patterns, performance issues, and improvement opportunities
- Best Practices Application: Applies language-specific best practices and patterns
- Interactive Approval: Presents each optimisation suggestion for your approval before implementation
- Guided Implementation: Implements approved changes with detailed explanations
Starting python optimization session...
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ The agent will analyze your python codebase and propose specific ┃
┃ optimizations. You'll be asked to approve each suggestion before ┃
┃ implementation. Type 'exit' or 'quit' to end the session. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Analyzing codebase structure...
Found 23 Python modules with potential optimizations
Optimization Suggestion #1:
File: src/data_processor.py
Issue: Using list comprehension in a loop can be optimized
Suggestion: Replace with generator expression for memory efficiency
[y/n] Do you approve this optimization?
| Option | Description |
|---|---|
--orchestrator |
Specify provider:model for main operations |
--cypher |
Specify provider:model for graph queries |
--repo-path |
Path to repository (defaults to current directory) |
--batch-size |
Override Memgraph flush batch size |
--reference-document |
Path to reference documentation |