Skip to main content

forge — Local Coding Agent

PyPI Version CI Status PyPI Downloads License Discord

Autonomous coding agent that runs locally — Your own AI developer powered by Gemini (planning) + Qwen3.5 (coding)

Why Forge?

┌─────────────────────────────────────────────────────────────────────────────┐
│                              FORGE ARCHITECTURE                              │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐                  │
│   │   USER      │────▶│   MASTER    │────▶│   AUTO      │                  │
│   │   INPUT     │     │   BRAIN     │     │   RUNNER    │                  │
│   └─────────────┘     │  (Gemini)   │     └──────┬──────┘                  │
│                       └──────┬──────┘            │                          │
│                              │                   ▼                          │
│                              │            ┌─────────────┐                  │
│                              │            │   WORKER    │                  │
│                              │            │ (Qwen3.5)   │                  │
│                              │            └──────┬──────┘                  │
│                              │                   │                          │
│                              ▼            ┌────────▼────────┐              │
│                       ┌─────────────┐     │   FEEDBACK     │              │
│                       │  CONTEXT    │     │   LOOP         │              │
│                       │  ENGINE     │◀────│                │              │
│                       └──────┬──────┘     └────────────────┘              │
│                              │                                                 │
│         ┌────────────────────┼────────────────────┐                        │
│         │                    │                    │                        │
│         ▼                    ▼                    ▼                        │
│  ┌─────────────┐     ┌─────────────┐     ┌─────────────┐                 │
│  │  VECTOR     │     │   PROJECT    │     │  PERSISTENT │                 │
│  │  STORE      │     │   GRAPH      │     │  MEMORY    │                 │
│  │  (FAISS)    │     │  (NetworkX)  │     │             │                 │
│  └─────────────┘     └─────────────┘     └─────────────┘                 │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Dual-LLM Architecture

Component Model Purpose
Master Brain Gemini 2.5 Flash High-level planning, code review, task batching
Local Worker Qwen 3.5 (via LM Studio) Fast iterative code execution

Features

🚀 Performance

  • Query Caching: LRU cache (128 entries) for repeated semantic searches
  • HTTP Connection Pooling: Reused connections in Brain and Worker for reduced latency
  • Parallel Indexing: ThreadPoolExecutor for indexing large files (>1KB) in parallel

🛡️ Reliability

  • Custom Exceptions: Specific error types (BrainError, WorkerError, etc.) for better debugging
  • Retry with Backoff: Exponential backoff for transient network failures
  • Graceful Degradation: Components work independently when optional dependencies fail
  • Checkpoint System: Pause every N tasks for human review and rollback

⚙️ Configuration

  • Pydantic Validation: Type-safe configuration with validation
  • Environment Validation: Clear error messages for missing required settings

🧠 Memory System

  • Cross-Session Memory: Persistent memory that survives between sessions
  • Session Logger: Track all operations with compression
  • Handoff Packets: Generate context packets for handoff to other agents

Install

# Quick install (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/Tushaarxr/forge/main/install.sh | bash

# Quick install (Windows PowerShell)
irm https://raw.githubusercontent.com/Tushaarxr/forge/main/install.ps1 | iex

# Or with pipx
pipx install forge-coder

# Or from source
git clone https://github.com/Tushaarxr/forge.git
cd forge
pip install -e ".[dev]"

With Docker

# Build and run
docker build -t forge-agent .
docker run -it -e GEMINI_API_KEY=your_key -v $(pwd):/workspace forge-agent auto "build a todo app"

# Or with docker-compose
GEMINI_API_KEY=your_key docker-compose run forge auto "build a todo app"

Quickstart (3 steps)

# 1. One-time setup
forge setup

# 2. Navigate to your project
cd my-project/

# 3. Let Forge build it!
forge auto "build a FastAPI todo app with SQLite and JWT auth"

Commands

Command Description
forge setup One-time wizard: API keys + LM Studio check
forge init Index files into vector store + build dependency graph
forge run Interactive mode with feedback loop
forge auto Autonomous end-to-end build with checkpoints
forge chat Interactive REPL for incremental changes
forge status Show project status and metrics
forge init Initialize project context
forge remember Save important info to memory
forge recall Query from persistent memory
forge handoff Generate cross-agent context packet

Requirements

Architecture Deep Dive

User Goal
    │
    ▼
┌────────────────────────────────────────────────────────────────┐
│                      MASTER BRAIN (Gemini)                     │
│  • Breaks goal into ordered task list                          │
│  • Batch reviews completed work                                │
│  • Provides high-level planning and review                    │
└────────────────────────────────────────────────────────────────┘
    │
    ▼
┌────────────────────────────────────────────────────────────────┐
│                      AUTO RUNNER                               │
│  • Iterates through task queue                                │
│  • Pauses every N tasks for checkpoint                        │
│  • Handles retry logic and dependency tracking                │
└────────────────────────────────────────────────────────────────┘
    │
    ▼
┌────────────────────────────────────────────────────────────────┐
│                      LOCAL WORKER (Qwen3.5)                    │
│  • Executes code in real-time                                  │
│  • Parses <<<FILE:>>> and <<<PATCH:>>> blocks                  │
│  • Returns file changes + patch modifications                 │
└────────────────────────────────────────────────────────────────┘
    │
    ▼
┌────────────────────────────────────────────────────────────────┐
│                      FEEDBACK LOOP                             │
│  • Applies changes with .forge_backup                         │
│  • Handles rollback on failure                                │
│  • Integrates with vector store + project graph              │
└────────────────────────────────────────────────────────────────┘

Key Technologies

Technology Purpose
FAISS Vector similarity search for semantic code lookup
NetworkX Project dependency graph (imports, functions, classes)
SentenceTransformers Code embeddings for semantic search
Pydantic Type-safe configuration validation
httpx Async HTTP client with connection pooling

Documentation

Contributing

# Clone and setup
git clone https://github.com/Tushaarxr/forge.git
cd forge

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run with debug logging
FORGE_LOG_LEVEL=DEBUG forge auto "your goal"

License

MIT License — See LICENSE for details.


Built with 💻 by developers, for developers

Metadata

Release files for forge-coder 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forge-coder 0.2.5
File Size Uploaded Provenance Actions
forge_coder-0.2.5.tar.gz 90.9 kB Without provenance Details for forge_coder-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for forge-coder 0.2.5
File Interpreter ABI Platform Actions
forge_coder-0.2.5-py3-none-any.whl Python 3 none any Details for forge_coder-0.2.5-py3-none-any.whl

Total release size: 167.0 kB

Release files / forge_coder-0.2.5.tar.gz

Download URL forge_coder-0.2.5.tar.gz
Size 90.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e4f6dfc6ab58b263bba59563fd6d5d5e427da30a34804833c882e9bd8728ce1
BLAKE2b-256 checksum
How to use checksums
4b17599b928b914ef3282b18cc96034bc74e36dd048af8d445daf5fd8f76a1cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / forge_coder-0.2.5-py3-none-any.whl

Download URL forge_coder-0.2.5-py3-none-any.whl
Size 76.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d16685231dc2b852cfeb40fa306b8fb597bef3b07f90dcb3d71fa5f00476110b
BLAKE2b-256 checksum
How to use checksums
5f3cab185b926a474bbb91193f4fb6545a7a70aa94e53461c4152eeccb761cf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for forge-coder 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page