A local, zero-cost, multi-agent Python MVP demonstrating SaaS orchestration running entirely locally via Ollama using the qwen3.5:4b model.
Local-Claude-Brain demonstrates a fully automated, local multi-agent architecture (Planner -> Executor). This project breaks down a Python refactoring task into granular steps: a Planner Agent formulates a step-by-step refactoring approach, and an Executor Agent implements those exact steps to transform bad code into high-quality code. This architecture operates autonomously without incurring any third-party API costs.
- Language: Python 3.x
- AI Provider: Ollama (Local)
- LLM: Qwen3.5:4b (
qwen3.5:4b) - Libraries:
ollama,rich
- Install Ollama: Download and install Ollama from ollama.com.
- Pull the Model: Open your terminal and pull the Qwen3.5 model. Keep the Ollama app running in the background.
ollama run qwen3.5:4b
-
Clone the repository:
git clone https://github.com/yourusername/Local-Claude-Brain.git cd Local-Claude-Brain -
Install dependencies:
pip install -r requirements.txt
Execute the orchestrator to see the multi-agent loop in action:
python orchestrator.pyWhat to expect:
- You will see the Planner Agent output its step-by-step refactoring plan to the console in yellow.
- The Executor Agent will generate the refactored text under the hood based on that exact plan.
- A success message in green will appear, and the final polished Python script will be saved down to
clean_calculator.py.
This base multi-agent foundation can be scaled for high-value B2B use cases:
- Legacy Code Refactoring: Automatically ingest legacy monoliths piece-by-piece, plan modernization steps, and rewrite into clean microservices, prioritizing documentation and type safety.
- Automated QA Validation: A multi-agent loop where an Executor writes code and a distinct QA Agent immediately writes and runs unit tests, passing bugs/failures back to the Executor in a self-healing loop.
- Local Data Sanitization: Process sensitive local PII/PHI data where one agent evaluates data privacy risks and redacts sensitive entities before passing the cleaned data to downstream applications.
- Reviewer Agent Loop: Add a "Reviewer" agent that critiques the Executor's output and loops execution until arbitrary quality thresholds are met prior to outputting.
- Local File-System Tool Calls: Empower agents with function calling to autonomously read, list, search, and write across an entire codebase footprint rather than just single files.
- Vision Model Support: Integrate models like LlaVa or Qwen-VL to consume physical architectural diagrams, UI mockups, or bug screenshots, translating them directly into agentic logic schemas.