Autonomous AI Software Factory - Production-grade multi-agent system
Project description
๐ค AI Software Factory - Claude Code Alternative
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,/pwdcommands 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
.mdfiles to theskills/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)
Installation
The recommended way to install AI Software Factory securely is via pipx (or pip), which makes the ai-factory command globally available anywhere on your system.
# 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-..."
Local Development
If you want to contribute to the project or run it locally from the source code:
# Clone the repository
git clone https://github.com/ATANU0023/Ai-factory.git
cd Ai-factory/software-factory
# Install in editable mode
pip install -e .
# Set up environment variables
cp .env.example .env
# Edit .env and add your OPENROUTER_API_KEY
# Launch the factory!
ai-factory
Usage
Option 1: Work on Existing Project (Recommended)
# Navigate to your project
cd C:\Users\YourName\Projects\my-web-app
# Launch AI Factory
ai-factory
๐ฌ 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
ai-factory
๐ฌ 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
ai-factory
๐ฌ 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 theskills/directory. - Auto-Injection: The
SkillManagerautomatically 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/
โโโ src/ai_software_factory/ # Core Package
โ โโโ agents/ # LangGraph AI agents
โ โโโ memory/ # ChromaDB & semantic cache
โ โโโ sandbox/ # Docker execution environment
โ โโโ tools/ # Filesystem/shell capabilities
โ โโโ orchestrator/ # LangGraph workflow
โ โโโ router/ # Model routing logic
โ โโโ observability/ # Logging & telemetry
โ โโโ config/ # Configuration
โ โโโ ai_factory.py # Main CLI interface
โ โโโ main.py # Core factory logic
โโโ tests/ # Pytest test suite
โโโ pyproject.toml # Package configuration
โโโ README.md # This file
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:
- Claude Code by Anthropic
- Cursor IDE
- GitHub Copilot Workspace
Built with:
- LangGraph - Agent orchestration
- ChromaDB - Vector database
- OpenRouter - LLM API gateway
๐ง Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: your-atanupramanik506@gmail.com
๐ Star History
If you find this project useful, please consider giving it a โญ star on GitHub!
Made with โค๏ธ by ATANU PRAMANIK
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_software_factory-1.0.3.tar.gz.
File metadata
- Download URL: ai_software_factory-1.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95aa415f853a8abfe0cd321147feff5f18c585e83b2b6b9d6ee554fa99acdcd
|
|
| MD5 |
a5972dbd7523f28eaa58ae0529149d01
|
|
| BLAKE2b-256 |
16fd2192988be24937f885ed16df73f4495cfedd8d6e27b72da1c985cdbdf1ce
|
File details
Details for the file ai_software_factory-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ai_software_factory-1.0.3-py3-none-any.whl
- Upload date:
- Size: 55.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7d8a865ee73882b290eb9c812800fb72a0600aa88d11ebfcaefe5636c9c914f
|
|
| MD5 |
443d0c7b3ee71f7e2db8bffc45a070ee
|
|
| BLAKE2b-256 |
ea9e93569a5f9d766612ef86698072b3c4b0d86560bd46f4e9d91da12f8c1778
|