Open-source desktop AI agent that gets work done — plans & self-corrects, agentic visual workflows, generative UI, and 100+ offline tools in one self-hostable stack.
$ npx -y skills add vixues/LeAgent --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
Repo: vixues/LeAgent
What's inside
LeAgent is an open-source desktop AI agent that doesn't just chat — it gets work done. Unlike cloud chatbots and code-only CLIs, LeAgent fuses three capabilities most agents keep apart: a streaming agent runtime that plans, calls tools, and self-corrects in one think-act loop; agentic visual workflows where the agent designs, runs, and refines ReactFlow DAGs (and every one of its tools is automatically a typed node); and a generative UI layer that streams live, interactive interfaces — KPI boards, slide decks, galleries — right into the chat. It ships 100+ built-in offline tools (documents, web, data, code, databases, media, game-art generation) plus a declarative rule engine, Agent Skills, and the Model Context Protocol — all running locally with zero external dependencies by default (SQLite, single process). Bring your own model keys, or run fully offline against a local Ollama / vLLM endpoint.
It is built for people who want a private, hackable, self-hosted alternative to closed agent products: your documents, sessions, and credentials never leave the machine unless you point a provider at a remote API.
QueryEngine session orchestrator drives both chat and background paths through one think-act loop, with durable checkpoints for pausing and resuming turns.SKILL.md bundles with progressive disclosure and on-demand loading. Ship built-in skills, install from links or archives, or plug in an HTTP skill registry.LeAgent is a complete agent platform, not a starter kit — the building blocks below are wired together and work out of the box, fully offline by default.
LeAgent is an async Python (FastAPI) backend plus a React 19 single-page app, packaged as a modular monolith. The backend uses a strict, downward-only layered domain model — File → Code → Project — over a single persistence layer, and every agent turn (chat, SDK, background task, sub-agent, workflow node) converges on one think-act kernel.
LeAgent/
├── backend/ # FastAPI backend (Python 3.11+, uv-managed)
│ └── leagent/
│ ├── agent/ # QueryEngine orchestrator, planner, subagents
│ ├── sdk/ # Versioned public Agent SDK (runtime, kernel, protocols)
│ ├── api/ # FastAPI routers (v1 + incubating v2)
│ ├── llm/ # LLM service, providers, transport, streaming, generation
│ ├── tools/ # 100+ tools across 13 categories
│ ├── workflow/ # Workflow engine, nodes, art-asset pipeline, templates
│ ├── context/ # Source-driven, relevance-gated prompt assembly
│ ├── prompts/ # Layered PromptBuilder, registry, templates
│ ├── memory/ # Episodic / semantic / procedural agent memory
│ ├── skills/ # Agent Skills v1.0 loader + registry
│ ├── rules/ # Declarative YAML rule engine
│ ├── mcp/ # Model Context Protocol
│ ├── file/ code/ project/ # Layered file → code → project domain model
│ ├── db/ # Persistence: engine, SQLModel models, repositories
│ └── services/ # DB, auth, chat, session, gen-ui, cron, ...
├── frontend/ # React 19 + TypeScript SPA (Vite, Zustand, React Query)
├── desktop/ # Electron shell (bundled Python runtime)
├── deploy/ # Dockerfile + SQLite-only Compose
├── config/ # Demo workflows + workflow templates
├── docs/ # Architecture, guides, deployment docs
└── start.sh / start.ps1 # Dev orchestrator (uv + npm)
Regardless of where a request enters, it flows through one set of well-defined boundaries. Each ingress mints a single ExecutionRun (with a run_id and, for child scopes, a parent_run_id), goes through a thin facade, runs on the shared kernel, and persists to durable state with one owner per state class:
Ingress HTTP/SSE · WebSocket · Cron · Background task · GenUI
│
▼
Facade ServiceManager.runtime_context · AgentRuntime · WorkflowService
│
▼
Kernel run_loop → QueryEngine → tool executor (single think-act loop)
│
▼
State TieredSessionStore · CheckpointStore · WorkflowStateStore
│
▼
Observe EventManager (FLOW_*/TASK_*/AGENT_*) · OpenTelemetry
leagent.sdk.kernel.run_loop. Turns pause to a durable checkpoint when they await user input, then resume exactly where they left off.WorkflowExecutor, which stages ready batches, runs independent branches concurrently, and applies centralized retry/backoff and timeouts.TieredSessionStore, paused turns in CheckpointStore (agent_checkpoints), and workflow runs in WorkflowStateStore — no shared mutable state across subsystems.See AGENTS.md for the full subsystem map and docs/technical/execution-topology.md for the authoritative agent-loop / workflow-engine state contract.
Every tool is auto-exposed as a typed workflow node, so anything the agent can call can also be wired into a visual flow.
| Category | What it covers |
|---|---|
| Documents | Read/write Word, Excel, PPTX, PDF; OCR; classification; archives; text processing |
| Web | Search (DuckDuckGo / SearXNG / Bing), scraping, image & native media download |
| Data | Clean, merge, validate, transform, aggregate, SQL & vector search |
| Code | Sandboxed in-process scripts and a subprocess code-execution agent |
| Database | Schema-aware querying over the managed database |
| Generate | Word / Excel / PPTX / PDF / report / checklist / template-fill generators |
| Canvas / GenUI | Stream and patch declarative UI trees; publish canvases |
| Charts & Images | Chart generation and image processing |
| Media | Image / video / 3D / audio generation backends |
| Skills | Discover, install, and invoke Agent Skills |
| Workflow | Save, run, and inspect workflows from inside an agent turn |
| Integration | MCP, webhooks, channels, and external service calls |
| Utilities | Cron, tasks, rule matching, folders, text splitting, pet bubbles, and more |
Tool.<name> node automatically — exposing a new capability visually needs zero glue code.FileRefs through a unified file layer with HMAC-signed preview/download URLs.SKILL.md) with progressive disclosure: ship built-ins, install from links/archives, or connect an HTTP skill registry.Cost-tiered routing (tier1 reasoning / tier2 fast) with automatic failover — bring cloud keys, or stay fully local.
| Provider | Notes |
|---|---|
| DeepSeek | Recommended default; auto-aliased to tier1 (v4-pro) + tier2 (v4-flash); reasoning content + prompt-cache metrics |
| DashScope (Qwen) | Thinking + search modes |
| OpenAI / Anthropic / Azure OpenAI | Cloud frontier models |
| Ollama / vLLM | Fully local / self-hosted OpenAI-compatible inference |
Prerequisites: git, uv, Node.js 20+ or 22+
git clone https://github.com/vixues/LeAgent.git
cd LeAgent
./start.sh # backend :7860 + frontend :5173
The dev orchestrator syncs the Python env with uv, installs frontend deps, and (unless skipped) installs the Playwright Chromium used by web tools.
cd LeAgent/deploy
cp .env.example .env # set LEAGENT_SECRET_KEY + at least one provider key
docker compose up -d --build
API and interactive docs at http://localhost:8000/docs. The default image is a single SQLite-backed container; optional overlays add a local GPU vLLM service (docker-compose.vllm.yml).
# Backend
cd backend
uv sync --extra dev
uv run leagent init
uv run leagent app
# Frontend (separate terminal)
cd frontend
npm install && npm run dev
curl -fsSL https://vixues.com.cn/install.sh | bash
Set at least one provider key (env var or Settings → Environment secrets in the web UI, which writes ~/.leagent/.env). The most common knobs:
| Variable | Purpose |
|---|---|
LEAGENT_SECRET_KEY | App secret for signed URLs and session crypto (openssl rand -hex 32) |
DEEPSEEK_API_KEY | DeepSeek provider — auto-aliased as tier1 (reasoning) / tier2 (fast) |
OPENAI_API_KEY / ANTHROPIC_API_KEY / DASHSCOPE_API_KEY | Additional cloud providers |
VLLM_ENDPOINT / LLM_OLLAMA_ENDPOINT | Local / self-hosted OpenAI-compatible inference |
DATABASE_URL | Switch from SQLite to PostgreSQL |
LEAGENT_DEBUG | Enable debug logging |
See deploy/.env.example for the full annotated list.
Installers for each platform ship with every GitHub release — download and run. No separate Python, Node, or Docker install required; the build bundles its own Python runtime and backend.
| Platform | Download | Notes |
|---|---|---|
| Windows 10/11 (x64) | LeAgent-Setup-*.exe | NSIS installer; desktop + start-menu shortcut |
| macOS (Apple Silicon) | LeAgent-*-arm64.dmg | Unsigned — xattr -dr com.apple.quarantine /Applications/LeAgent.app after install |
| macOS (Intel) | LeAgent-*.dmg | Same Gatekeeper note as above |
| Linux (x64) | LeAgent-*.AppImage / LeAgent-*.deb | AppImage: chmod +x then run. .deb: sudo dpkg -i |
See all releases: https://github.com/vixues/LeAgent/releases
| Layer | Technology |
|---|---|
| Backend | Python 3.11+, FastAPI, Uvicorn/Gunicorn, SQLModel + Alembic, Pydantic v2, async I/O, OpenTelemetry |
| Frontend | React 19, TypeScript, Vite, Zustand, TanStack Query, ReactFlow, i18next (zh-CN / en-US / 汉文) |
| Desktop | Electron (ESM main process), bundled Python backend |
| Data | SQLite (default), PostgreSQL (optional), Milvus (optional vector memory) |
| Tooling | uv (Python), npm (frontend), Playwright, black + ruff, ESLint |
:7860 and the Vite frontend on :5173 (start.sh); the Docker image publishes the API on :8000.LEAGENT_HOME: the SQLite database (WAL mode) plus the working-uploads, knowledge, and coding-project trees. A complete backup is the database and that directory.DATABASE_URL and front the app with sticky sessions (the in-process execution registry and event bus are per-worker). Milvus is optional and only powers vector-backed memory recall./docs; set LEAGENT_DEBUG=true for verbose tracing.The full documentation set lives in docs/ — start with the architecture overview.
Issues and pull requests are welcome. Please:
cd backend && uv run pytest tests/ -v / cd frontend && npm run test).AGENTS.md for coding conventions and i18n rules (every new UI string must exist in both zh-CN and en-US bundles).See CONTRIBUTING.md for full guidelines and CODE_OF_CONDUCT.md for community standards.
Apache License 2.0 — see LICENSE.
.github/
CODEOWNERS
dependabot.yml
FUNDING.yml
ISSUE_TEMPLATE/
bug_report.yml
feature_request.yml
PULL_REQUEST_TEMPLATE.md
workflows/
ci.yml
desktop-release.yml
docs.yml
publish-pypi.yml
release.yml
.gitignore
AGENTS.md
backend/
.backend_deps_installed
.playwright_system_deps_marker
alembic.ini
docs/
ast-tools-boundary.md
code-gen-tool-args-parsing.md
tool-system.md
workflow-engine/
api-reference.md
architecture.md
art-asset-nodes.md
demo-flows-and-cron.md
io-reference.md
node-authoring.md
operations.md
overview.md
leagent/
__init__.py
agent/
__init__.py
base.py
coding_agent.py
content_parts.py
control.py
controller.py
current.py
deps.py
hooks.py
multimodal.py
planner.py
query_engine.py
query.py
recovery.py
runtime_profile.py
script_agent.py
state.py
subagent.py
tool_use_context.py
transitions.py
alembic/
__init__.py
env.py
runtime_config.py
script.py.mako
sync_runner.py
versions/
__init__.py
0001_agent_checkpoints.py
0002_workflow_state_snapshots.py
0003_chat_projects.py
0004_llm_request_log_linkage.py
0005_library_layer.py
0006_document_chunks.py
0007_coding_project_kind.py
0008_approval_decisions.py
0009_change_reviews.py
0010_chat_project_folder.py
0011_agent_traces.py
0012_agent_traces_root_span.py
0013_users_auth_fields.py
0014_agent_traces_nullable_json.py
0015_files_summary.py
api/
__init__.py
deps.py
middleware.py
router.py
schemas/
__init__.py
chat.py
errors.py
v1/
__init__.py
activities.py
admin/
__init__.py
tasks.py
users.py
auth.py
canvas.py
channels.py
chat/
chat_deps.py
chat_projects.py
__init__.py
agent_stream.py
approvals.py
attachments.py
context_sources.py
message_persistence.py
paths.py
reviews.py
sse.py
coding_projects.py
cron.py
documents.py
extensions.py
files.py
flows.py
folder_items.py
folders.py
health.py
image_gen.py
mcp.py
meta.py
metrics.py
models.py
pdf_research.py
pet_space.py
python_env.py
rules.py
settings_mail.py
settings_tokens.py
skills.py
stats.py
streams.py
tasks.py
templates.py
tools.py
traces.py
webhooks.py
workflow_assets.py
v2/
__init__.py
apps/
__init__.py
gateway/
__init__.py
infrastructure/
__init__.py
bootstrap.py
ratelimit.py
ws_fanout.py
bootstrap/
__init__.py
tools.py
channels/
__init__.py
agent_bridge.py
api/
__init__.py
channel.py
base.py
console/
__init__.py
channel.py
dingtalk/
__init__.py
channel.py
feishu/
__init__.py
channel.py
manager.py
outbound_artifacts.py
registry.py
renderer.py
web/
__init__.py
channel.py
wechat_work/
__init__.py
channel.py
weixin/
__init__.py
channel.py
client.py
crypto.py
login.py
media.py
store.py
chat_workflow/
__init__.py
arguments.py
compile.py
runner.py
schema.py
templates.py
workflow_embed.py
cli/
__init__.py
app_cmd.py
auth_cmd.py
bootstrap.py
channels_cmd.py
chat_cmd.py
chats_cmd.py
clean_cmd.py
config_cmd.py
cron_cmd.py
daemon_cmd.py
env_cmd.py
http.py
init_cmd.py
main.py
providers_cmd.py
rules_cmd.py
skills_cmd.py
stream_handler.py
tasks_cmd.py
templates_cmd.py
utils.py
webhooks_cmd.py
workflows_cmd.py
code/
__init__.py
artifacts.py
execution.py
fim.py
markup_guard.py
matplotlib_cjk.py
operations.py
packages.py
pipeline.py
runner.py
sandbox.py
syntax.py
workspace_edit.py
workspace.py
config/
__init__.py
config.py
constants.py
env_bootstrap.py
migrate_v2.py
settings.py
tier_env_guard.py
watcher.py
console/
__init__.py
context/
__init__.py
artifact_error_tracker.py
budget.py
cache.py
compression.py
file_state.py
ledger.py
manager.py
plugin.py
recipe.py
relevance.py
session_compression.py
sources/
__init__.py
active_project.py
art_playbook.py
base.py
capabilities.py
environment.py
gated_policy.py
identity.py
playbooks.py
policies.py
project_memory.py
recall.py
recent_reads.py
session_artifacts.py
session_attachments.py
tool_history.py
user_instructions.py
working_set.py
strategies/
__init__.py
dashscope.py
deepseek.py
types.py
working_set.py
cron/
__init__.py
base.py
executor.py
hooks.py
manager.py
repository.py
scheduler.py
db/
__init__.py
engine.py
models/
__init__.py
agent_checkpoint.py
agent_memory.py
agent_trace.py
approval_decision.py
base.py
canvas.py
change_review.py
chat_project.py
coding_project.py
cron.py
document_chunk.py
file.py
flow.py
folder.py
identity_stub.py
llm_request_log.py
message.py
pet_project.py
task.py
workflow_execution.py
workflow_state_snapshot.py
repositories/
__init__.py
agent_checkpoint.py
chat.py
document_chunks.py
files.py
tasks.py
workflow_executions.py
service.py
sqlite_compat.py
docgen/
__init__.py
charts.py
checklist.py
fonts.py
images.py
markdown.py
mathtext.py
model.py
omml.py
renderers/
__init__.py
docx.py
html.py
pdf.py
pptx.py
slides.py
tables.py
templates.py
themes.py
theming.py
exceptions/
__init__.py
auth.py
base.py
handlers.py
llm.py
rule.py
tool.py
workflow.py
extensions/
__init__.py
manager.py
official_registry.json
file/
__init__.py
attachment_context.py
primitives.py
quality.py
sandbox.py
service.py
storage/
__init__.py
backend.py
local.py
tool_output.py
library/
__init__.py
chunking.py
fts.py
gc.py
summary.py
llm/
__init__.py
base.py
capabilities/
__init__.py
adapters.py
bootstrap.py
profile.py
provider_stats.py
registry.py
router.py
circuit_breaker.py
domain_models/
__init__.py
dashscope_audio.py
diffusion/
__init__.py
adapter.py
manager.py
image.py
... 1600 moreShowing a partial view of a very large repo.
FAQ
leagent is a Claude Code plugin with 7 hand-picked skills for automation work, indexed on Flowy. Install it with the command on its page. It includes attendance-signin-sheet, data-analyzer, document-processor. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.