Local AI Agent Orchestrator: planner, coder, and reviewer agents over LM Studio with SQLite state, optional per-plan Git commits, and memory-safe model swapping
Project description
Local AI Agent Orchestrator
Local multi-agent coding pipeline for LM Studio and other OpenAI-compatible local servers: planner, coder, and reviewer with SQLite state, memory-aware model swaps, optional per-plan Git commits, and a unified interactive CLI UX across lao, lao init, lao configure-models, and lao run.
| Resource | Link |
|---|---|
| PyPI package | https://pypi.org/project/local-ai-agent-orchestrator/ |
| Project website | https://lao.keyhan.info |
| Source code | https://github.com/KEYHAN-A/local-ai-agent-orchestrator |
| Issues & feature requests | https://github.com/KEYHAN-A/local-ai-agent-orchestrator/issues |
| License | GPL-3.0-only — LICENSE file in this repository |
Install: pip install local-ai-agent-orchestrator (CLI: lao). Upgrade: pip install -U local-ai-agent-orchestrator.
Highlights
- Planner: decomposes a master plan into file-level micro-tasks (JSON).
- Coder: implements tasks with tool use (
file_read,file_write,shell_exec, …). - Reviewer: validates output (APPROVED / REJECTED with feedback); v1.1.0+ parses verdicts after stripping reasoning / think-block prefixes (R1-style models).
- Embedder: optional semantic file retrieval before coding (Nomic via LM Studio).
- Git (v1.3.0+): optional commits in each plan’s project folder (
LAO_PLAN.md,LAO_TASKS.json,LAO_REVIEW.log,lao(architect|coder|reviewer): …messages). See Git traceability below. - Unified CLI UX (v2.0.0+): one polished flow from home/status (
lao) to onboarding (lao init) to recovery (lao configure-models) and execution (lao run). - Resume by default: interrupted
coding/reviewtasks recover on restart; same plan content is deduplicated instead of re-decomposed.
Why not CrewAI / LangChain here?
This project uses the OpenAI Python SDK directly against LM Studio to avoid multi-agent framework token overhead (ReAct scaffolding) on small local context windows.
Requirements
- Python 3.10+
- LM Studio with local server enabled
- Models you configure in
factory.yaml(see docs/CONFIGURATION.md) - Apple Silicon tip: disable overly strict LM Studio Model Loading Guardrails if large models fail to load (Developer → Server Settings).
Install
cd local-ai-agent-orchestrator
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
Or run without install (adds src/ automatically):
python main.py health
From PyPI
pip install local-ai-agent-orchestrator
# pip install -U local-ai-agent-orchestrator # upgrade
Package index: https://pypi.org/project/local-ai-agent-orchestrator/.
Quick start
# Open interactive LAO home assistant
lao
# or run setup directly:
lao init
lao health
lao run
# In another terminal: add plans/*.md or use:
lao --plan plans/my_project.md --single-run run
CLI (lao)
| Command | Description |
|---|---|
lao run |
Watch plans/, process queue |
lao |
Interactive home assistant: environment status + guided next actions |
lao --plan FILE run |
Ingest one plan and process |
lao --single-run run |
One pass then exit |
lao status |
SQLite queue + token stats |
lao health |
LM Studio reachability + model keys |
lao configure-models |
Interactive remap of planner/coder/reviewer/embedder model keys |
lao retry-failed |
Retry failed tasks by moving failed tasks back to pending |
lao reset-failed |
Deprecated alias for lao retry-failed |
lao init |
Interactive onboarding: writes factory.yaml (+ factory.example.yaml), .lao/, plans/, optional README.md |
On TTY terminals, lao, lao init, lao configure-models, and lao run use a unified Rich-based visual style (branded panels, status tables, guided choices) for one seamless operator flow.
Global flags
| Flag | Purpose |
|---|---|
--config PATH |
factory.yaml (default: ./factory.yaml if present) |
--lm-studio-url URL |
Override base URL |
--ram-gb N |
Total RAM (logged; future tuning) |
--plain |
Classic scrolling log instead of the full-screen dashboard |
--no-git |
Disable per-plan Git snapshots and phase commits (overrides factory.yaml) |
--workspace, --plans-dir, --db |
Paths |
--planner-model, --coder-model, --reviewer-model, --embedder-model |
Override keys without editing YAML |
Environment: LM_STUDIO_BASE_URL, OPENAI_API_KEY, LAO_CONFIG (path to yaml), TOTAL_RAM_GB, WORKSPACE_ROOT, PLANS_DIR, DB_PATH. See .env.example.
Project layout (v1.2.0+)
After lao init, code for plans/MyPlan.md is written under ./MyPlan/ (same folder name as the plan stem, next to plans/). The database defaults to .lao/state.db. plans/README.md is never treated as a plan. See docs/CONFIGURATION.md.
Resume behavior: restarting lao run continues queue progress from SQLite; tasks interrupted mid-phase are recovered automatically. If you reuse the exact same plan content, LAO recognizes it and avoids starting over.
On a TTY, lao run uses a fixed Rich dashboard (phase, task, model swap line, memory gate summary, queue counts, filtered activity log). Use --plain for the old timestamped scrolling log (CI, pipes, or debugging).
Git traceability
Since v1.3.0, for each plan LAO targets <config_dir>/<plan-stem>/ (your project folder). When git.enabled is true in factory.yaml (default), LAO runs git init if needed, writes LAO_PLAN.md (plan snapshot), then commits after the plan snapshot, architect (writes LAO_TASKS.json), coder, and reviewer (appends LAO_REVIEW.log). Subjects look like lao(coder): task #42 … so you can git log or revert step by step. Requires git on your PATH and a configured user.name / user.email (repo-local or global). Disable with git.enabled: false or lao --no-git run.
Architecture
See docs/ARCHITECTURE.md.
flowchart LR
Plan[Markdown plan] --> Arch[Planner LLM]
Arch --> Q[SQLite queue]
Q --> Code[Coder LLM]
Code --> Rev[Reviewer LLM]
Rev --> Q
Documentation
- Website (marketing & overview): https://lao.keyhan.info — built from
docs/index.htmlon the default branch (docs/.nojekyllfor static assets). - docs/ARCHITECTURE.md — modules, queue, model swapping, Git commit cadence
- docs/CONFIGURATION.md —
factory.yaml, paths,git:settings - docs/CONTRIBUTING.md
- docs/PYPI_PUBLISH.md — maintainers: publishing to PyPI
Clone for development:
git clone https://github.com/KEYHAN-A/local-ai-agent-orchestrator.git
cd local-ai-agent-orchestrator
Changelog
v2.2.1
- Reviewer parsing robustness: reviewer JSON validation now accepts markdown-fenced JSON and mixed-text wrappers, preventing false task rejection when verdict payloads are wrapped in ```json blocks.
- Regression coverage: added validator tests for fenced reviewer responses so
APPROVEDverdicts are correctly recognized.
v2.2.0
- Pipeline completion correctness: plans now move to
completedwhen all tasks reach a terminal state (completedorfailed) instead of stayingactive. - Recovery ergonomics: added
lao retry-failed(withreset-failedalias) backed by queue API support to quickly re-run failed tasks. - Scheduler robustness: pending tasks that depend on failed prerequisites are now auto-failed with explicit dependency-block feedback.
- Reviewer quality gate tuning: reviewer guidance and parsing now treat minor-only feedback as non-blocking, reducing over-rejection loops on local models.
- Test coverage: added tests for terminal-plan detection, failed-task reset, failed-dependency scheduling behavior, and reviewer minor-finding approval behavior.
v2.1.1
- Website metadata: replaced hardcoded site version text with live GitHub/PyPI badges and direct latest-release links.
- Publish workflow reliability: release-triggered PyPI automation now avoids duplicate tag/release uploads while keeping manual re-run support.
v2.1.0
- Orchestration quality: planner chunk-resume preflight, dependency-aware scheduling, role-batched coder/reviewer waves, and structured findings storage.
- Production gates: validator framework for placeholder/schema/project-integrity checks, configurable quality gates, and per-plan
quality_report.jsontraceability. - Release automation: GitHub Actions workflow added for automated PyPI publish on release/tag with Trusted Publishing support.
v2.0.0
- Unified UX:
lao,lao init, andlao configure-modelsnow match the polishedlao runvisual language with guided, step-based TTY flows. - Operator continuity: post-setup/post-config next actions (
health/run) are integrated, reducing dead ends between commands. - Recovery clarity: startup checks and model-remap guidance are surfaced as first-class interactive flows for smoother long-running operation.
v1.3.0
- Git: Optional per-plan repo under
./<plan-stem>/: snapshotLAO_PLAN.md,LAO_TASKS.jsonafter architect, commits after coder/reviewer withlao(…):messages;LAO_REVIEW.logfor review outcomes. Configgit:infactory.yaml; CLI--no-git. - Site: Redesigned GitHub Pages landing (hero, features, install).
v1.2.0
- Layout: Per-plan code lives at
./<plan-stem>/next toplans/(not under.lao/workspaces/). Fallback workspace.lao/_misc/. - CLI: Rich full-screen dashboard on TTY (
--plainfor classic log).lao initadds workspaceREADME.mdwhen missing (--skip-readmeto skip). - Fix: SQLite no longer opens a bogus
Nonedatabase file when using the defaultTaskQueue()constructor. - Branding: LAO palette on CLI, site, and docs.
v1.1.1
- Layout (superseded in v1.2.0):
lao initcreated.lao/workspaces/+plans/; per-plan workspace was.lao/workspaces/<plan-stem>/(fromplans/Foo.md→Foo). - Plans: Ignore
plans/README.mdwhen scanning for plans. - Defaults: Reviewer model default deepseek-r1-distill-qwen-32b (adjust
keyto matchlms ls). - Docs: docs/PYPI_PUBLISH.md; local token notes template
PYPI_PUBLISH.local.md(gitignored).
v1.1.0
- Reviewer: Strip chain-of-thought (think tags) and detect
APPROVED/REJECTEDon any line — fixes false rejections from DeepSeek-R1–style reasoning before the verdict. - Docs and landing page updated for this release.
v1.0.0
- Initial stable release:
laoCLI, planner / coder / reviewer pipeline, SQLite state, memory gate, GitHub Pages docs.
Disclaimer
This software can execute shell commands and write files as configured. Run in a trusted workspace. GPL-3.0 applies to this project; third-party libraries have their own licenses.
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 local_ai_agent_orchestrator-2.2.1.tar.gz.
File metadata
- Download URL: local_ai_agent_orchestrator-2.2.1.tar.gz
- Upload date:
- Size: 72.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd1540bfd9e808446ead8df7fffa6086ce5bc3c23069e3ac5e2578e7c4cbabdd
|
|
| MD5 |
a37940e2cfbf3d1f1b6cda691f8c8467
|
|
| BLAKE2b-256 |
a03164e6afd2381795457ff6f3f40d7251b9cb934f78ec96585d73a9176de8b8
|
Provenance
The following attestation bundles were made for local_ai_agent_orchestrator-2.2.1.tar.gz:
Publisher:
publish-pypi.yml on KEYHAN-A/local-ai-agent-orchestrator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_ai_agent_orchestrator-2.2.1.tar.gz -
Subject digest:
dd1540bfd9e808446ead8df7fffa6086ce5bc3c23069e3ac5e2578e7c4cbabdd - Sigstore transparency entry: 1166798994
- Sigstore integration time:
-
Permalink:
KEYHAN-A/local-ai-agent-orchestrator@1259dd67eb2eabc5e568eae424f6d00cea6dc9d3 -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/KEYHAN-A
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1259dd67eb2eabc5e568eae424f6d00cea6dc9d3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file local_ai_agent_orchestrator-2.2.1-py3-none-any.whl.
File metadata
- Download URL: local_ai_agent_orchestrator-2.2.1-py3-none-any.whl
- Upload date:
- Size: 70.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
438e9808e5a1600bc4ff06fb767088c9b53b90ebed812024f8c97043fc79a257
|
|
| MD5 |
3b97ba71fd55bdd79208095c970b3791
|
|
| BLAKE2b-256 |
5ccb5e67fca0cd36e138d415ee86790f39f5a5b6c8ccf4886766bd6a37a5403b
|
Provenance
The following attestation bundles were made for local_ai_agent_orchestrator-2.2.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on KEYHAN-A/local-ai-agent-orchestrator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
local_ai_agent_orchestrator-2.2.1-py3-none-any.whl -
Subject digest:
438e9808e5a1600bc4ff06fb767088c9b53b90ebed812024f8c97043fc79a257 - Sigstore transparency entry: 1166799060
- Sigstore integration time:
-
Permalink:
KEYHAN-A/local-ai-agent-orchestrator@1259dd67eb2eabc5e568eae424f6d00cea6dc9d3 -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/KEYHAN-A
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1259dd67eb2eabc5e568eae424f6d00cea6dc9d3 -
Trigger Event:
release
-
Statement type: