MCPcopy Index your code
hub / github.com/CraftsMan-Labs/SimpleAgents

github.com/CraftsMan-Labs/SimpleAgents @v0.5.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.2 ↗ · + Follow
2,096 symbols 6,397 edges 203 files 431 documented · 21% updated 31d ago★ 337 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SimpleAgents

SimpleAgents is a YAML workflow engine for AI products. Define nodes, routing, schemas, and workers in one config. Run it in Python or TypeScript. Ship today.

Every agentic SaaS is a config.

GitHub Stars GitHub Forks GitHub Issues License

PyPI Version PyPI Downloads npm Version npm Downloads

Links

  • Docs: https://docs.simpleagents.craftsmanlabs.net/
  • Playground: https://yamslam.craftsmanlabs.net/playground

Start Here

  • New here? Start with docs/WORKFLOW_QUICKSTART.md for your first working workflow.
  • Using Python? Go to docs/BINDINGS_PYTHON.md.
  • Using TypeScript / Node? Go to docs/BINDINGS_NODE.md.
  • Using Rust directly? Go to docs/QUICKSTART.md.
  • Want runnable examples? Go to docs/EXAMPLES.md.

Install

pip install simple-agents-py     # Python
npm install simple-agents-node   # TypeScript / Node

How It Works

  1. Define your workflow as YAML -- nodes, edges, structured outputs, routing
  2. Run it with 10 lines of Python or TypeScript
  3. Ship -- streaming, images, Langfuse/Jaeger observability all work out of the box

Every email classifier, document processor, intake system, interview bot, and support agent is the same pattern: LLM nodes with structured outputs and deterministic routing. SimpleAgents makes that pattern a config file.

Who It's For

  • Teams building classifiers, support flows, document workflows, intake systems, or other structured AI flows
  • Builders who want routing, schemas, streaming, and custom workers without writing framework glue

Use It When

  • You want structured LLM workflows with deterministic routing
  • You want the same workflow config to run in Python or TypeScript
  • You want custom worker steps and tracing without building the plumbing yourself

If you only need one prompt call and no workflow, use the lower-level bindings directly.

Quick Example

workflow.yaml

id: classifier
version: 1.0.0
entry_node: classify

nodes:
  - id: classify
    node_type:
      llm_call:
        model: gpt-4.1-mini
        messages_path: input.messages
        heal: true
    config:
      output_schema:
        type: object
        properties:
          category:
            type: string
            enum: [billing, support, sales]
        required: [category]
        additionalProperties: false
      user_input_prompt: |
        Classify the user message. Return JSON only.

edges: []

run.py

import json, os
from pathlib import Path
from dotenv import load_dotenv
from simple_agents_py import Client
from simple_agents_py.workflow_request import (
    WorkflowExecutionRequest, WorkflowMessage, WorkflowRole,
)

load_dotenv()
client = Client(os.environ["WORKFLOW_PROVIDER"], api_base=os.environ["WORKFLOW_API_BASE"], api_key=os.environ["WORKFLOW_API_KEY"])

req = WorkflowExecutionRequest(
    workflow_path=str(Path("workflow.yaml").resolve()),
    messages=[WorkflowMessage(role=WorkflowRole.USER, content="I need a refund for order #1234")],
)
result = client.run_workflow(req)
print(json.dumps(result, indent=2))

SimpleAgents Builder Skills

npx skills add CraftsMan-Labs/SimpleAgents --skill simpleagents-builder

That's it. Your agentic SaaS is a config.

What You Get

  • YAML workflow engine -- classify, route, extract, generate as a graph config
  • Python + TypeScript -- pip install / npm install, run with 10 lines
  • Streaming -- real-time LLM output streaming
  • Images -- multimodal input (text + images) in the same workflow
  • Human-in-the-loop (HITL) -- pause on human_input nodes (choice, text, form) and resume safely
  • Workflow evals -- output-shaped JSONL datasets with code-side evaluators (Python + TypeScript)
  • JSON healing -- auto-fix truncated/malformed LLM JSON output
  • Observability -- Langfuse and Jaeger via OpenTelemetry, one env block
  • Custom workers -- plug your own code (DB lookups, APIs) into the workflow graph
  • Rust core -- blazing fast engine with Python, TypeScript, and WASM bindings

Documentation

  • Start here: docs/WORKFLOW_QUICKSTART.md -- install, create YAML, run in Python/TypeScript
  • Examples: docs/EXAMPLES.md
  • YAML system guide: docs/YAML_WORKFLOW_SYSTEM.md
  • Python binding: docs/BINDINGS_PYTHON.md
  • Node/TypeScript binding: docs/BINDINGS_NODE.md
  • WASM binding: docs/BINDINGS_WASM.md
  • Observability (Langfuse/Jaeger): docs/TRACING_ARCHITECTURE.md
  • Rust quick start: docs/QUICKSTART.md
  • Rust usage: docs/USAGE.md
  • Troubleshooting: docs/TROUBLESHOOTING.md
  • Development/Contributing: docs/DEVELOPMENT.md
  • Docs map: docs/DOCS_MAP.md

Contributing

  • Start with CONTRIBUTING.md and docs/DEVELOPMENT.md.
  • Follow task-tracking expectations in TODO.md (and SUBAGENT_TODO.md for larger parallel workstreams).
  • Run relevant test/lint/format/parity commands before opening a PR.

License

  • Repository license file: LICENSE (Apache License 2.0 text).
  • Package metadata in workspace includes MIT OR Apache-2.0 for crates/bindings where declared.

For redistribution/compliance-sensitive usage, verify root license files and per-package metadata.

Star History

Star History Chart

Extension points exported contracts — how you extend this code

Provider (Interface)
(no doc) [12 implementers]
crates/simple-agent-type/src/provider.rs
YamlWorkflowEventSink (Interface)
(no doc) [12 implementers]
crates/simple-agents-workflow/src/yaml_runner/contracts.rs
RetryableError (Interface)
Trait for determining if an error is retryable. Implements retry detection logic per CODING_GUIDELINES.md:296-318 [1 implementers]
crates/simple-agents-providers/src/common/error.rs
WorkflowStreamPrinterOptions (Interface)
(no doc)
bindings/wasm/simple-agents-wasm/workflow_stream_printer.d.ts
WorkflowRunnerEvent (Interface)
(no doc)
crates/simple-agents-napi/workflow_event.d.ts
YamlWorkflowLlmExecutor (Interface)
(no doc) [6 implementers]
crates/simple-agents-workflow/src/yaml_runner/contracts.rs
WorkflowRunnerEvent (Interface)
(no doc)
bindings/wasm/simple-agents-wasm/workflow_event.d.ts
WorkflowTelemetryConfigNapi (Interface)
(no doc)
crates/simple-agents-napi/index.d.ts

Core symbols most depended-on inside this repo

get
called by 385
crates/simple-agents-workflow/src/observability/tracing.rs
map
called by 212
crates/simple-agent-type/src/coercion.rs
push
called by 170
crates/simple-agents-workflow/src/yaml_runner/stream_filters.rs
as_str
called by 156
crates/simple-agents-workflow/src/yaml_runner/contracts.rs
is_empty
called by 133
crates/simple-agents-healing/src/streaming.rs
feed
called by 110
crates/simple-agents-healing/src/streaming.rs
parse
called by 104
crates/simple-agents-healing/src/parser.rs
message
called by 72
crates/simple-agent-type/src/request.rs

Shape

Function 1,186
Method 462
Class 323
Interface 67
Enum 51
Route 7

Languages

Rust72%
Python19%
TypeScript9%

Modules by API surface

crates/simple-agents-workflow/src/yaml_runner/tests.rs94 symbols
crates/simple-agents-py/src/lib.rs89 symbols
bindings/wasm/simple-agents-wasm/rust/src/lib.rs69 symbols
crates/simple-agents-napi/src/lib.rs66 symbols
crates/simple-agents-providers/src/openai/mod.rs52 symbols
crates/simple-agents-healing/src/parser.rs48 symbols
crates/simple-agents-workflow/src/yaml_runner/contracts.rs47 symbols
crates/simple-agent-type/src/message.rs45 symbols
crates/simple-agents-core/src/client.rs43 symbols
crates/simple-agents-workflow/src/observability/tracing.rs41 symbols
crates/simple-agents-healing/tests/parser_tests.rs41 symbols
crates/simple-agents-healing/src/coercion.rs40 symbols

For agents

$ claude mcp add SimpleAgents \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact