{"id":48047042,"url":"https://github.com/randomvariable/synwire","last_synced_at":"2026-04-04T14:18:39.996Z","repository":{"id":344613552,"uuid":"1176818552","full_name":"randomvariable/synwire","owner":"randomvariable","description":"Rust framework for building LLM-powered applications and agents — typed state graphs, tool calling, MCP, and AG-UI protocol support","archived":false,"fork":false,"pushed_at":"2026-03-15T14:39:34.000Z","size":441,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T03:42:53.463Z","etag":null,"topics":["a2a","ag-ui","agents","llm","mcp","ml"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/randomvariable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-09T12:09:39.000Z","updated_at":"2026-03-15T17:43:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/randomvariable/synwire","commit_stats":null,"previous_names":["randomvariable/synwire"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/randomvariable/synwire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomvariable%2Fsynwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomvariable%2Fsynwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomvariable%2Fsynwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomvariable%2Fsynwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randomvariable","download_url":"https://codeload.github.com/randomvariable/synwire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomvariable%2Fsynwire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["a2a","ag-ui","agents","llm","mcp","ml"],"created_at":"2026-04-04T14:18:38.658Z","updated_at":"2026-04-04T14:18:39.788Z","avatar_url":"https://github.com/randomvariable.png","language":"Rust","readme":"# Synwire\n\nA Rust framework for building LLM-powered applications and agents with full async support and compile-time type safety.\n\nSynwire provides idiomatic Rust implementations of core LLM abstractions — language models, embeddings, vector stores, graph-based orchestration, tools, and more — drawing from LangChain/LangGraph patterns adapted for Rust's type system and ownership model.\n\n## Status\n\n**M1 complete** — core traits, orchestrator with generic typed state, OpenAI and Ollama providers, checkpointing. See the [roadmap](docs/roadmap.md) for upcoming work units.\n\n## Architecture\n\n```text\ncrates/\n├── synwire-core/                  # Foundational traits: Vfs, Tool, agents, embeddings, vector stores, MCP\n├── synwire-orchestrator/          # Graph execution: StateGraph\u003cS\u003e, CompiledGraph\u003cS\u003e\n├── synwire-checkpoint/            # Checkpoint persistence traits + in-memory impl\n├── synwire-checkpoint-sqlite/     # SQLite checkpoint backend (WAL mode)\n├── synwire-llm-openai/            # OpenAI provider\n├── synwire-llm-ollama/            # Ollama provider\n├── synwire-derive/                # Proc macros: #[tool], #[derive(State)]\n├── synwire-agent/                 # Agent runtime: VFS providers, middleware, strategies, MCP, sessions\n├── synwire-mcp-adapters/          # MCP client: multi-server, stdio/HTTP/WebSocket transports\n├── synwire-chunker/               # Tree-sitter AST-aware code chunking (14 languages)\n├── synwire-embeddings-local/      # Local embedding + reranking via fastembed-rs\n├── synwire-vectorstore-lancedb/   # LanceDB vector store\n├── synwire-index/                 # Semantic indexing pipeline: walk → chunk → embed → store\n├── synwire-lsp/                   # LSP client (12 tools)\n├── synwire-dap/                   # DAP debug client (sessions, breakpoints, evaluate)\n├── synwire-sandbox/               # Process sandboxing: isolation, approval gates\n├── synwire-storage/               # StorageLayout, RepoId/WorktreeId\n├── synwire-agent-skills/          # Agent skills (agentskills.io spec, Lua/Rhai/WASM)\n├── synwire-daemon/                # Singleton background process per product\n├── synwire-mcp-server/            # MCP server binary — stdio proxy to daemon\n├── synwire-test-utils/            # Proptest strategies and test fixtures (not published)\n└── synwire/                       # Convenience re-exports\n```\n\n### Design Principles\n\n- **Trait-based**: Core abstractions are Rust traits in `synwire-core`, with provider crates supplying concrete implementations\n- **Generic typed state**: `StateGraph\u003cS\u003e` and `CompiledGraph\u003cS\u003e` are generic over `S: State` — compile-time type safety, not runtime JSON casting\n- **Async-first**: All I/O operations are `async` (tokio), with optional sync wrappers\n- **Type-safe**: `Result\u003cT, E\u003e` for all fallible operations, `#![forbid(unsafe_code)]` on core crates, zero panics in library code\n- **BDD test-first**: All features developed with test-first workflow using proptest for property-based testing\n\nSee [`.specify/memory/constitution.md`](.specify/memory/constitution.md) for the full project constitution.\n\n## Installing the MCP Server\n\nPre-built binaries for Linux (amd64/arm64) and macOS (amd64/arm64) are attached to each [GitHub Release](https://github.com/randomvariable/synwire/releases).\n\n**Homebrew (macOS/Linux — recommended)**:\n\n```bash\nbrew install randomvariable/tap/synwire-mcp-server\n```\n\n**Direct download (macOS)**:\n\n```bash\n# After downloading and extracting the archive:\nxattr -d com.apple.quarantine ./synwire-mcp-server\n```\n\n\u003e macOS Sequoia 15.1+ sets a quarantine flag on files downloaded via a browser. Run the `xattr` command above to remove it, or install via Homebrew (which re-signs the binary automatically).\n\n## Prerequisites\n\n- Rust (latest stable, edition 2024)\n- [cargo-make](https://github.com/sagiegurari/cargo-make) (`cargo install cargo-make`)\n- [cargo-nextest](https://nexte.st/) (`cargo install cargo-nextest`)\n\n## Getting Started\n\n```bash\n# Build all crates\ncargo build\n\n# Run all Tier 1 CI checks (fmt + clippy + test + doctest + doc)\ncargo make ci\n\n# Run tests only\ncargo make test\n\n# Auto-format\ncargo make fmt-fix\n```\n\n## Quick Example\n\nChat with an LLM:\n\n```rust\nuse synwire_llm_openai::ChatOpenAI;\nuse synwire_core::language_models::BaseChatModel;\nuse synwire_core::messages::Message;\n\nlet model = ChatOpenAI::builder()\n    .model(\"gpt-4o\")\n    .api_key(std::env::var(\"OPENAI_API_KEY\")?)\n    .build()?;\n\nlet messages = vec![Message::human(\"What is Rust?\")];\nlet result = model.invoke(\u0026messages, None).await?;\nprintln!(\"{}\", result.message.content());\n```\n\nReAct agent with tools:\n\n```rust\nuse synwire_orchestrator::prebuilt::create_react_agent_messages;\nuse synwire_orchestrator::messages::MessagesState;\nuse synwire_core::messages::Message;\nuse synwire_core::tools::StructuredTool;\n\n// Define a tool the agent can call\nlet weather_tool = StructuredTool::builder()\n    .name(\"get_weather\")\n    .description(\"Get the current weather for a city\")\n    .parameters(serde_json::json!({\n        \"type\": \"object\",\n        \"properties\": { \"city\": { \"type\": \"string\" } },\n        \"required\": [\"city\"]\n    }))\n    .func(|input| Box::pin(async move {\n        let city = input[\"city\"].as_str().unwrap_or(\"unknown\");\n        Ok(synwire_core::tools::ToolOutput {\n            content: format!(\"{city}: 18°C, partly cloudy\"),\n            artifact: None,\n        })\n    }))\n    .build()?;\n\nlet agent = create_react_agent_messages(model, vec![Box::new(weather_tool)])?;\nlet result = agent.invoke(MessagesState {\n    messages: vec![Message::human(\"What's the weather in London?\")],\n}).await?;\n\nfor msg in \u0026result.messages {\n    println!(\"{msg:?}\");\n}\n```\n\nGraph with typed state — useful for multi-step workflows where each node\nreads and writes structured fields instead of raw JSON:\n\n```rust\nuse synwire_derive::State;\nuse synwire_orchestrator::graph::StateGraph;\nuse synwire_orchestrator::constants::END;\nuse serde::{Serialize, Deserialize};\n\n#[derive(Debug, Clone, Serialize, Deserialize, State)]\nstruct ResearchState {\n    query: String,\n    #[reducer(topic)]\n    sources: Vec\u003cString\u003e,\n    summary: String,\n}\n\nlet mut graph = StateGraph::\u003cResearchState\u003e::new();\ngraph.add_node(\"search\", Box::new(|mut state: ResearchState| {\n    Box::pin(async move {\n        state.sources.push(format!(\"Result for: {}\", state.query));\n        Ok(state)\n    })\n}))?;\ngraph.add_node(\"summarise\", Box::new(|mut state: ResearchState| {\n    Box::pin(async move {\n        state.summary = format!(\"Found {} sources\", state.sources.len());\n        Ok(state)\n    })\n}))?;\ngraph.set_entry_point(\"search\");\ngraph.add_edge(\"search\", \"summarise\");\ngraph.set_finish_point(\"summarise\");\n\nlet compiled = graph.compile()?;\nlet result = compiled.invoke(ResearchState {\n    query: \"Rust async runtimes\".into(),\n    sources: vec![],\n    summary: String::new(),\n}).await?;\nassert_eq!(result.summary, \"Found 1 sources\");\n```\n\n## Available `cargo make` Tasks\n\n| Task | Description |\n|------|-------------|\n| `cargo make ci` | Tier 1: fmt + clippy + test + doctest + doc |\n| `cargo make test` | Run tests with nextest |\n| `cargo make clippy` | Lint with deny warnings |\n| `cargo make fmt` | Check formatting |\n| `cargo make fmt-fix` | Auto-format |\n| `cargo make doc` | Build docs (deny warnings) |\n| `cargo make coverage` | Generate lcov coverage report |\n| `cargo make ci-full` | Tier 1 + Tier 2 (includes geiger) |\n| `cargo make nightly` | Property tests + audit + MSRV check |\n\n## Documentation\n\n- [Roadmap](docs/roadmap.md) — work units and critical path to AG-UI\n- [Architecture](docs/src/explanation/architecture.md) — crate organisation and design decisions\n- [Getting Started](docs/src/getting-started/first-chat.md) — tutorials\n- [How-To Guides](docs/src/how-to/custom-tool.md) — task-oriented recipes\n- [Project Constitution](.specify/memory/constitution.md) — development principles and quality gates\n\n## Contributing\n\nContributions welcome. Please read the [project constitution](.specify/memory/constitution.md) for coding standards and architectural principles before submitting a PR.\n\n## Licence\n\nDual-licensed under Apache 2.0 and MIT — see [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomvariable%2Fsynwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandomvariable%2Fsynwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomvariable%2Fsynwire/lists"}