{"id":38543151,"url":"https://github.com/evmts/smithers","last_synced_at":"2026-02-21T21:15:59.400Z","repository":{"id":332198386,"uuid":"1128579105","full_name":"evmts/smithers","owner":"evmts","description":"Advanced AI Agents in React","archived":false,"fork":false,"pushed_at":"2026-02-10T12:33:43.000Z","size":116306,"stargazers_count":49,"open_issues_count":9,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T17:00:10.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://smithers.sh","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evmts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-05T21:13:36.000Z","updated_at":"2026-02-10T12:34:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/evmts/smithers","commit_stats":null,"previous_names":["evmts/smithers"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/evmts/smithers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmts%2Fsmithers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmts%2Fsmithers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmts%2Fsmithers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmts%2Fsmithers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evmts","download_url":"https://codeload.github.com/evmts/smithers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evmts%2Fsmithers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29593911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T07:13:10.520Z","updated_at":"2026-02-18T20:00:55.243Z","avatar_url":"https://github.com/evmts.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smithers\n\n**Deterministic, durable AI workflows defined as React components.**\n\n## What Smithers Does\n\n* Defines workflows as React component trees\n* Executes tasks in sequence, parallel, or loops\n* Persists every task result to SQLite\n* Validates outputs against Zod schemas\n* Re-renders the workflow after each step\n* Resumes exactly where it left off after crashes\n* Supports subscriptions\n\nThere is no hidden in-memory state. Every task result is stored as:\n\n```\n(runId, nodeId, iteration) → validated output row\n```\n\n---\n\n## Example\n\n```tsx\nimport { createSmithers, Sequence } from \"smithers-orchestrator\";\nimport { z } from \"zod\";\n\nconst analyzeSchema = z.object({\n  summary: z.string(),\n  severity: z.enum([\"low\", \"medium\", \"high\"]),\n});\n\nconst fixSchema = z.object({\n  patch: z.string(),\n  explanation: z.string(),\n});\n\nconst { Workflow, Task, smithers, outputs } = createSmithers({\n  analyze: analyzeSchema,\n  fix: fixSchema,\n});\n\nexport default smithers((ctx) =\u003e (\n  \u003cWorkflow name=\"bugfix\"\u003e\n    \u003cSequence\u003e\n      \u003cTask id=\"analyze\" output={outputs.analyze} agent={analyzer}\u003e\n        {`Analyze the bug: ${ctx.input.description}`}\n      \u003c/Task\u003e\n\n      \u003cTask id=\"fix\" output={outputs.fix} agent={fixer}\u003e\n        {`Fix this issue: ${ctx.output(\"analyze\", { nodeId: \"analyze\" }).summary}`}\n      \u003c/Task\u003e\n    \u003c/Sequence\u003e\n  \u003c/Workflow\u003e\n));\n```\n\nThis defines a two-stage DAG:\n\n```\nanalyze → fix\n```\n\nAfter `analyze` completes:\n\n* Output is validated against `analyzeSchema`\n* Written to SQLite\n* The tree re-renders\n* `fix` becomes runnable\n\nIf the process crashes, Smithers resumes from the last completed node.\n\n---\n\n## Install\n\nRequires Bun ≥ 1.3.\n\n```bash\nbun add smithers-orchestrator ai @ai-sdk/anthropic zod\n```\n\n---\n\n## Mental Model\n\n### 1. React Tree = Execution Plan\n\nYour JSX tree is not UI. It is a declarative execution graph.\n\n* `\u003cWorkflow\u003e` is the root.\n* `\u003cTask\u003e` is a node.\n* `\u003cSequence\u003e` runs children in order.\n* `\u003cParallel\u003e` runs children concurrently.\n* `\u003cRalph\u003e` repeats children until a condition is met.\n\nAfter each task finishes, Smithers re-renders the tree with updated context.\n\nIf new nodes are unblocked, they become runnable.\n\n---\n\n### 2. Zod Schemas = Durable Tables\n\nEach output schema becomes a SQLite table. Pass the schema directly to `\u003cTask\u003e` via the `outputs` object returned by `createSmithers`:\n\n```ts\nconst analyzeSchema = z.object({\n  summary: z.string(),\n  severity: z.enum([\"low\", \"medium\", \"high\"]),\n});\n\nconst { Workflow, Task, smithers, outputs } = createSmithers({\n  analyze: analyzeSchema,\n});\n\n// outputs.analyze === analyzeSchema (the ZodObject, by reference)\n```\n\n* Agent output must validate against the schema.\n* If validation fails, the task retries (with error feedback).\n* Validated output is persisted.\n\nThis makes workflows typed, inspectable, and reproducible.\n\n---\n\n### 3. Deterministic Execution\n\nExecution order is:\n\n* Depth-first\n* Left-to-right\n* Unblocked nodes only\n\nThere is no hidden scheduler logic in user code.\n\n---\n\n## Core Components\n\n| Component    | Purpose                        |\n| ------------ | ------------------------------ |\n| `\u003cWorkflow\u003e` | Root container                 |\n| `\u003cTask\u003e`     | AI or static task node         |\n| `\u003cSequence\u003e` | Ordered execution              |\n| `\u003cParallel\u003e` | Concurrent execution           |\n| `\u003cBranch\u003e`   | Conditional execution          |\n| `\u003cRalph\u003e`    | Loop until condition satisfied |\n\n---\n\n## Validation and Retries\n\nIf an agent returns malformed JSON:\n\n1. Smithers appends the validation error to the prompt\n2. Retries the task\n3. Persists only valid output\n\n```tsx\n\u003cTask\n  id=\"analyze\"\n  output={outputs.analyze}\n  agent={analyzer}\n  retries={2}\n\u003e\n  Analyze the codebase\n\u003c/Task\u003e\n```\n\n---\n\n## Looping with `\u003cRalph\u003e`\n\n`\u003cRalph\u003e` repeats its children until a condition becomes true.\n\nEach iteration is stored separately in the database.\n\n```tsx\n\u003cRalph\n  until={ctx.latest(\"review\", \"validate\")?.approved}\n  maxIterations={5}\n\u003e\n  \u003cTask id=\"implement\" output={outputs.implement} agent={coder}\u003e\n    Fix based on feedback\n  \u003c/Task\u003e\n\n  \u003cTask id=\"validate\" output={outputs.review} agent={reviewer}\u003e\n    Review the implementation\n  \u003c/Task\u003e\n\u003c/Ralph\u003e\n```\n\n---\n\n## Dynamic Branching\n\nBecause the workflow re-renders after each task, you can branch with normal JSX:\n\n```tsx\n\u003cTask id=\"assess\" output={outputs.assess} agent={analyst}\u003e\n  Assess complexity\n\u003c/Task\u003e\n\n{ctx.output(\"assess\", { nodeId: \"assess\" }).complexity === \"high\" ? (\n  \u003cTask id=\"plan\" output={outputs.plan} agent={architect}\u003e\n    Plan implementation\n  \u003c/Task\u003e\n) : (\n  \u003cTask id=\"implement\" output={outputs.code} agent={coder}\u003e\n    Quick fix\n  \u003c/Task\u003e\n)}\n```\n\n---\n\n## CLI\n\n```bash\nsmithers run workflow.tsx --input '{\"description\": \"Fix bug\"}'\nsmithers resume workflow.tsx --run-id abc123\nsmithers list workflow.tsx\nsmithers approve workflow.tsx --run-id abc123 --node-id review\n```\n\n---\n\n## Built-in Tools\n\n```tsx\nimport { read, edit, bash, grep, write } from \"smithers-orchestrator\";\n```\n\n* Sandboxed to workflow root\n* `bash` is network-disabled by default\n\n---\n\n## How Execution Works\n\n1. Render React tree\n2. Identify runnable tasks\n3. Execute task\n4. Validate output\n5. Persist to SQLite\n6. Re-render\n7. Repeat\n\nCrash at any point → resume from last persisted step.\n\n---\n\n## When to Use Smithers\n\n* Multi-step AI workflows\n* Tool-using agents\n* Systems requiring resumability\n* Human-in-the-loop review cycles\n* Typed, inspectable AI pipelines\n\nNot intended for:\n\n* Single prompt calls\n* Stateless toy scripts\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevmts%2Fsmithers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevmts%2Fsmithers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevmts%2Fsmithers/lists"}