Skip to main content

Autonomous AI Software Factory - Production-grade multi-agent system

Project description

๐Ÿค– AI Software Factory - Claude Code Alternative

Python 3.13+ License: MIT OpenRouter

A Claude Code-like AI assistant that can read, modify, and generate code in any project. Built with hierarchical multi-agent architecture (Architect โ†’ Developer โ†’ Auditor) for production-quality software development.


โœจ Features

๐ŸŽฏ Claude Code-like Interface

  • Work in ANY directory - Navigate to any project and start coding
  • Full filesystem access - Read, edit, and modify files anywhere
  • Directory navigation - /cd, /pwd commands like a shell
  • Undo/Redo system - Unlimited undo/redo for all changes
  • Automatic backups - Every edit is backed up automatically

๐Ÿง  Intelligent Assistance

  • Smart intent detection - Automatically distinguishes casual chat from project requests
  • Dual mode operation - Switch between chat mode and build mode with /mode
  • Clarifying questions - Understands your requirements before building (toggle with /questions)
  • Multi-agent workflow - Architect plans, Developer codes, Auditor tests
  • Context-aware - Analyzes existing codebase structure and style
  • Dynamic Skills Injection - Instantly teach agents new capabilities, rules, and guidelines by adding .md files to the skills/ directory
  • Clean terminal output - Human-readable format, no verbose JSON logs

๐Ÿ›ก๏ธ Safety First

  • Diff previews - Review all changes before applying
  • Confirmation prompts - Explicit approval for file modifications
  • Backup system - Timestamped backups in .ai-factory-backups/
  • Graceful degradation - Works without Docker, pytest, or other tools

๐Ÿ’ฐ Completely Free

  • Uses OpenRouter API (free tier available)
  • No subscription fees
  • No usage limits (depends on your OpenRouter quota)

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13 or higher
  • OpenRouter API key (free at openrouter.ai)

The easiest and most seamless way to install the AI Software Factory globally on Windows is using our one-line installer:

# Open Windows PowerShell and paste this:
irm https://raw.githubusercontent.com/ATANU0023/Ai-factory/main/install.ps1 | iex

(This automatically handles all dependency configurations, Python pipx bindings, and system paths for you).

Manual Installation (Mac/Linux)

If you are not on Windows or prefer to install it manually:

# Install the package globally
pipx install ai-software-factory

# Set your API key as an environment variable
# Mac/Linux:
export OPENROUTER_API_KEY="sk-..."
# Windows PowerShell:
$env:OPENROUTER_API_KEY="sk-..."

Usage

Option 1: Work on Existing Project (Recommended)

# Navigate to your project
cd C:\Users\YourName\Projects\my-web-app

# Launch AI Factory
python path/to/software-factory/ai_factory.py

๐Ÿ’ฌ You: /pwd
๐Ÿ“‚ Current directory: C:\Users\YourName\Projects\my-web-app

๐Ÿ’ฌ You: /list
๐Ÿ“ Files (23):
  ๐Ÿ“„ app/main.py
  ๐Ÿ“„ app/routes.py
  ...

๐Ÿ’ฌ You: Add error handling to all API endpoints

๐Ÿค– Analyzing code...
๐Ÿค– Generating modifications...
โœ… Modified 3 files

Option 2: Create New Project

python ai_factory.py

๐Ÿ’ฌ You: Create a Flask REST API with user authentication

๐Ÿค” Let me ask a few questions...
1. What database should I use? (SQLite/PostgreSQL/MySQL)
   ๐Ÿ’ฌ Your answer: SQLite

2. Include JWT authentication?
   ๐Ÿ’ฌ Your answer: Yes

โœ… Building project...
โœ… SUCCESS: Generated 12 files

๐Ÿ“‹ Commands Reference

Command Description Example
/help Show help message /help
/pwd Show current directory /pwd
/cd <path> Change directory /cd C:\Projects\app
/list List files /list
/read <file> View file content /read app.py
/edit <file> Edit a file /edit config.py
/undo Undo last change /undo
/redo Redo undone change /redo
/backups List backup files /backups
/questions Toggle clarifying Q&A /questions
/mode <type> Switch mode: chat or build /mode chat
/status Show current settings /status
/ask <prompt> Generate without questions /ask Hello world
quit/exit Exit program quit

๐Ÿ’ฌ Smart Input Modes

The system intelligently detects whether you're having a conversation or requesting a project:

Casual Conversation (automatically detected):

๐Ÿ’ฌ You: how are u
๐Ÿค– I'm here to help build software! What would you like to create?

๐Ÿ’ฌ You: what is today's date?
๐Ÿค– Today is Monday, April 06, 2026

๐Ÿ’ฌ You: what can you do?
๐Ÿค– I can generate code, modify projects, add features, fix bugs...

Project Requests (automatically detected):

๐Ÿ’ฌ You: create a todo app
๐Ÿš€ Building your project...

๐Ÿ”„ Mode Switching

Control how the system interprets your input:

# Chat Mode - All input treated as questions
๐Ÿ’ฌ You: /mode chat
โœ… Switched to CHAT mode
๐Ÿ’ฌ Chat mode: All inputs treated as questions (use /ask for projects)

๐Ÿ’ฌ You: tell me about Python
๐Ÿค– [Conversational response]

๐Ÿ’ฌ You: /ask create a calculator
๐Ÿš€ Building your project...

# Build Mode - All input treated as project requests (default)
๐Ÿ’ฌ You: /mode build
โœ… Switched to BUILD mode

๐Ÿ’ฌ You: create a weather app
๐Ÿš€ Building your project...

๐Ÿ“Š Status Display

Check your current configuration anytime:

๐Ÿ’ฌ You: /status

๐Ÿ“Š Current Settings:
   Mode: BUILD
   Clarifying Questions: ON
   Working Directory: C:\Projects\my-app

๐Ÿ’ก Use '/mode chat' for conversational mode
๐Ÿ’ก Use '/mode build' for project building (default)

๐Ÿ—๏ธ Architecture

Multi-Agent System

User Request
    โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Architect   โ”‚ โ† Creates detailed development plan
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Developer   โ”‚ โ† Generates code based on plan
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Auditor    โ”‚ โ† Tests and validates code
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ†“
   Success/Fix

Technology Stack

  • LangGraph - Agent orchestration and workflow management
  • ChromaDB - Vector database for semantic memory and caching
  • OpenRouter - Unified LLM API (supports DeepSeek, GPT-4, Claude, etc.)
  • Pydantic Settings - Configuration management
  • Docker (Optional) - Sandboxed code execution

๐Ÿ“– Examples

Example 1: Modify Existing Web App

cd my-flask-project
python ai_factory.py

๐Ÿ’ฌ You: Add rate limiting to all API endpoints

๐Ÿค– Reading app/routes.py...
๐Ÿค– Analyzing structure...
๐Ÿค– Generating modifications...

๐Ÿ“‹ Preview changes:
--- a/app/routes.py
+++ b/app/routes.py
@@ -5,6 +5,7 @@
 from flask import Flask
+from flask_limiter import Limiter

 @app.route('/api/users')
+@limiter.limit("100/hour")
 def get_users():
     ...

โœ… Apply changes? (yes/no): yes
โœ… Modified 1 file
๐Ÿ’พ Backup created

Example 2: Add New Feature

๐Ÿ’ฌ You: Add user authentication with JWT

๐Ÿค– Analyzing project structure...
๐Ÿค– Checking dependencies...
๐Ÿค– Generating authentication system...

โœ… Created 3 new files:
  โ€ข app/auth.py
  โ€ข app/models/user.py
  โ€ข app/routes/auth_routes.py

โœ… Modified 2 files:
  โ€ข app/routes.py
  โ€ข requirements.txt

Example 3: Fix Bugs

๐Ÿ’ฌ You: Fix the null pointer error in user profile page

๐Ÿค– Reading app/routes.py...
๐Ÿค– Identifying issue...
๐Ÿค– Generating fix...

๐Ÿ“‹ Fix: Add null check before accessing user.avatar_url
--- a/app/routes.py
+++ b/app/routes.py
@@ -45,7 +45,7 @@
 def profile(user_id):
     user = User.query.get(user_id)
-    avatar = user.avatar_url
+    avatar = user.avatar_url if user else "/static/default.png"
     return render_template('profile.html', avatar=avatar)

โœ… Apply fix? (yes/no): yes
โœ… Bug fixed!

Example 4: Casual Conversation

# The system automatically detects casual conversation
๐Ÿ’ฌ You: how are u

๐Ÿค– I'm here to help build software! Please describe what you'd like to create.

๐Ÿ’ฌ You: what can you do?

๐Ÿค– I can generate code, modify projects, add features, fix bugs, write tests, and more!
   Try asking me to build something like "Create a todo app" or "Build a REST API".

# Or switch to chat mode for extended conversations
๐Ÿ’ฌ You: /mode chat
โœ… Switched to CHAT mode

๐Ÿ’ฌ You: explain async/await in Python
๐Ÿค– [Detailed explanation of async/await...]

๐Ÿ’ฌ You: /mode build
โœ… Switched to BUILD mode

โš™๏ธ Configuration

Environment Variables

Create a .env file:

# Required
OPENROUTER_API_KEY=sk-or-v1-your-api-key-here

# Optional - Model Configuration
# All models can be customized via environment variables
PLANNING_MODEL_NAME=deepseek/deepseek-chat
PLANNING_MODEL_MAX_TOKENS=8192
PLANNING_MODEL_TEMPERATURE=0.3

CODE_GENERATION_MODEL_NAME=deepseek/deepseek-chat
CODE_GENERATION_MODEL_MAX_TOKENS=8192
CODE_GENERATION_MODEL_TEMPERATURE=0.2

CONVERSATIONAL_MODEL_NAME=deepseek/deepseek-chat
CONVERSATIONAL_MODEL_MAX_TOKENS=500
CONVERSATIONAL_MODEL_TEMPERATURE=0.7

LOG_ANALYSIS_MODEL_NAME=meta-llama/llama-3.1-8b-instruct
LOG_ANALYSIS_MODEL_MAX_TOKENS=2048
LOG_ANALYSIS_MODEL_TEMPERATURE=0.1

SUMMARIZATION_MODEL_NAME=openai/gpt-4o-mini
SUMMARIZATION_MODEL_MAX_TOKENS=2048
SUMMARIZATION_MODEL_TEMPERATURE=0.3

# Other Settings
LOG_LEVEL=INFO
ENABLE_SEMANTIC_CACHE=true
MAX_RETRIES=3

Get your API key at openrouter.ai/keys

Model Selection

Models are configured in config/settings.py and can be overridden via environment variables:

# Default configuration in settings.py
planning_model = ModelConfig(
    model_name="deepseek/deepseek-chat",
    max_tokens=8192,
    temperature=0.3,
)

# Override in .env file
PLANNING_MODEL_NAME=anthropic/claude-3.5-sonnet
PLANNING_MODEL_TEMPERATURE=0.5

See openrouter.ai/models for available models.

Available Models

  • Planning Model: Used for architecture design and project planning
  • Code Generation Model: Used for writing code
  • Conversational Model: Used for Q&A and casual chat
  • Log Analysis Model: Used for analyzing execution logs
  • Summarization Model: Used for creating summaries

๐Ÿ”’ Safety Features

1. Automatic Backups

Every file modification creates a timestamped backup:

.ai-factory-backups/
  โ”œโ”€โ”€ app_routes.py.1712345678.bak
  โ”œโ”€โ”€ config_py.1712345679.bak
  โ””โ”€โ”€ ...

2. Undo/Redo

๐Ÿ’ฌ You: /edit main.py
[Make changes]

๐Ÿ’ฌ You: /undo
โœ… Undid changes to main.py

๐Ÿ’ฌ You: /redo
โœ… Redid changes to main.py

3. Diff Preview

All edits show unified diff before applying - review exact changes before confirming.

4. Confirmation Prompts

File overwrites require explicit "yes" confirmation. Cancel anytime.

5. Clean Terminal Output

The interactive interface uses human-readable logging:

  • Only shows warnings and errors (no verbose JSON logs)
  • Clean, minimal output for better user experience
  • Detailed JSON logs still available for debugging (non-interactive mode)

๐Ÿ†š Comparison with Other Tools

Feature AI Factory Claude Code Cursor GitHub Copilot
Cost FREE $20/mo $20/mo $10/mo
Multi-agent workflow โœ… โŒ โŒ โŒ
Smart intent detection โœ… โŒ โŒ โŒ
Chat/Build modes โœ… โŒ โŒ โŒ
Clarifying questions โœ… โŒ โŒ โŒ
Auto backups โœ… โŒ โŒ โŒ
Undo/Redo โœ… โœ… โœ… โŒ
Clean terminal output โœ… โœ… โœ… N/A
Open source โœ… โŒ โŒ โŒ
Self-hosted โœ… โŒ โŒ โŒ

๐Ÿง  Dynamic Skills System

The AI Software Factory features a dynamic skill system that allows you to instantly customize agent behavior and capabilities without changing any core code.

  • How it works: Simply drop a Markdown (.md) file into the skills/ directory.
  • Auto-Injection: The SkillManager automatically reads all skill files and injects them as strict instructions into the base prompt of every agent (Architect, Developer, Auditor).
  • Use Cases: Perfect for enforcing coding standards, UI guidelines, specific framework patterns, or custom organizational rules.

Example skills/frontend_rules.md:

# Frontend Requirements
- Always use semantic HTML5 tags instead of generic `div`s.
- Keep the user interface clean with plenty of white space.
- Write accessible interfaces (include aria-labels, alt text).

๐Ÿ› ๏ธ Development

Project Structure

ai-software-factory/
โ”œโ”€โ”€ agents/              # Multi-agent system
โ”‚   โ”œโ”€โ”€ architect_agent.py
โ”‚   โ”œโ”€โ”€ developer_agent.py
โ”‚   โ”œโ”€โ”€ auditor_agent.py
โ”‚   โ””โ”€โ”€ supervisor_agent.py
โ”œโ”€โ”€ orchestrator/        # Workflow orchestration
โ”‚   โ””โ”€โ”€ workflow_graph.py
โ”œโ”€โ”€ memory/             # Vector storage & caching
โ”‚   โ”œโ”€โ”€ vector_store.py
โ”‚   โ””โ”€โ”€ semantic_cache.py
โ”œโ”€โ”€ router/             # LLM routing & fallback
โ”‚   โ””โ”€โ”€ model_router.py
โ”œโ”€โ”€ sandbox/            # Code execution (optional Docker)
โ”‚   โ””โ”€โ”€ docker_executor.py
โ”œโ”€โ”€ tools/              # Utility tools
โ”‚   โ””โ”€โ”€ file_manager.py
โ”œโ”€โ”€ observability/      # Logging & metrics
โ”‚   โ””โ”€โ”€ logger.py
โ”œโ”€โ”€ config/             # Configuration
โ”‚   โ””โ”€โ”€ settings.py
โ”œโ”€โ”€ ai_factory.py       # Main CLI interface
โ”œโ”€โ”€ main.py             # Core factory logic
โ””โ”€โ”€ requirements.txt    # Dependencies

Running Tests

# Install test dependencies
pip install pytest pytest-cov

# Run tests
pytest tests/ -v

# With coverage
pytest tests/ --cov=. --cov-report=html

๐Ÿ“ License

MIT License - See LICENSE file for details.


๐Ÿ™ Acknowledgments

Inspired by:

Built with:


๐Ÿ“ง Support


๐ŸŒŸ Star History

If you find this project useful, please consider giving it a โญ star on GitHub!


Made with โค๏ธ by ATANU PRAMANIK

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_software_factory-1.0.5.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_software_factory-1.0.5-py3-none-any.whl (55.3 kB view details)

Uploaded Python 3

File details

Details for the file ai_software_factory-1.0.5.tar.gz.

File metadata

  • Download URL: ai_software_factory-1.0.5.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for ai_software_factory-1.0.5.tar.gz
Algorithm Hash digest
SHA256 cfcd37e391e3968b0df83038617bd70616e2fdeffaceae16765bcac8d4b327a4
MD5 a103d4afb2d3244a0e4f8510b86ed464
BLAKE2b-256 dc66343b39160828df6a6ce29b83ca67dc98682fb71809eb9e2cacda459d3a3d

See more details on using hashes here.

File details

Details for the file ai_software_factory-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_software_factory-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 692834288216ccdfcbb9b2fec39ed1b64d7c6f33e8cbff4ecece14f7bcd20e4b
MD5 44e03c12bcd1bd89cbaa84c43534df78
BLAKE2b-256 f3bc6681b98bfc4e8f5f8f96cab81da082539f1f2b860665eefbb9dc9987a392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page