g3  by dhanji

Rust AI agent for code generation and task automation

Created 3 months ago
346 stars

Top 80.2% on SourcePulse

GitHubView on GitHub
Project Summary

G3 is a versatile AI coding agent built in Rust, designed to assist users with code generation, task automation, and interacting with various Large Language Models (LLMs). It offers a flexible, modular architecture suitable for developers and power users seeking to streamline coding workflows, manage complex projects, and automate system tasks. G3 provides robust error handling and intelligent context management, aiming to improve productivity and reduce development friction.

How It Works

G3 employs a modular Rust workspace architecture, featuring distinct crates for core functionalities. The g3-core crate handles the agent engine, context window management (including 50-80% thinning and auto-summarization), a versatile tool system (file operations, shell commands, TODOs), and a streaming response parser for real-time LLM interaction. The g3-providers crate abstracts LLM interactions, supporting providers like Anthropic, Databricks, and local models via llama.cpp with Metal acceleration, offering flexibility in backend choices. Task execution is managed by g3-execution, enabling sequential or parallel strategies with automatic error recovery.

Quick Start & Requirements

  • Primary install/run: Build the project using cargo build --release, then execute from the build directory: ./target/release/g3.
  • Prerequisites: Rust toolchain (implied by cargo). Specific LLM providers might require additional setup (e.g., API keys). WebDriver requires ChromeDriver installation. macOS Accessibility API (--macax) requires granting permissions. Local models via llama.cpp may benefit from Metal (macOS) or CUDA (Linux/Windows) acceleration.
  • Configuration: A TOML configuration file (~/.config/g3/config.toml) is automatically created on first run with sensible defaults.
  • Links: CONTRIBUTING.md, LICENSE, config.example.toml, Code Search Guide, Flock Mode Guide, macOS Accessibility Tools Guide.

Highlighted Details

  • Intelligent Context Management: Features automatic context thinning (50-80% thresholds), smart auto-summarization, and dynamic token allocation for different LLM providers.
  • Provider Flexibility: Supports multiple LLM backends (Anthropic, Databricks, local via llama.cpp) through a unified, hot-swappable interface.
  • Computer Control: Includes experimental capabilities for mouse/keyboard automation, UI inspection, OCR, and macOS Accessibility API integration (--macax).
  • Code Search: Embedded tree-sitter enables syntax-aware code search across multiple programming languages.
  • Planning Mode: Offers a structured, requirements-driven development workflow with Git integration for iterative implementation and automated commit messages.
  • Flock Mode: Enables parallel multi-agent development for large, modular projects.
  • Robust Error Handling: Implements automatic retries with exponential backoff and jitter for recoverable errors.

Maintenance & Community

The provided README does not contain specific details regarding maintainers, community channels (like Discord/Slack), or project roadmap. Contributions are welcomed via CONTRIBUTING.md.

Licensing & Compatibility

G3 is released under the MIT License, permitting commercial use and modification.

Limitations & Caveats

Computer Control and macOS Accessibility API features are explicitly marked as experimental. Setting up WebDriver requires installing ChromeDriver or configuring Safari's remote automation. Granting necessary OS-level permissions (e.g., Accessibility on macOS) is a manual step required for certain features.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
7
Issues (30d)
3
Star History
129 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elvis Saravia Elvis Saravia(Founder of DAIR.AI).

DeepCode by HKUDS

2.8%
14k
AI agents transform ideas into production-ready code
Created 8 months ago
Updated 4 days ago
Feedback? Help us improve.