{"id":26848952,"url":"https://github.com/i365dev/agent_forge","last_synced_at":"2025-05-02T19:18:46.908Z","repository":{"id":283918204,"uuid":"951331566","full_name":"i365dev/agent_forge","owner":"i365dev","description":"AgentForge is a powerful and flexible signal-driven workflow framework designed for building intelligent, dynamic, and adaptive systems.","archived":false,"fork":false,"pushed_at":"2025-03-30T08:12:21.000Z","size":145,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T15:08:33.035Z","etag":null,"topics":["adaptive-systems","agent","dsl","dynamic-workflows","elixir","workflow"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i365dev.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}},"created_at":"2025-03-19T14:11:07.000Z","updated_at":"2025-04-30T18:15:10.000Z","dependencies_parsed_at":"2025-03-23T03:19:01.285Z","dependency_job_id":"cd307a42-a207-4cc1-bd3a-666599ab791d","html_url":"https://github.com/i365dev/agent_forge","commit_stats":null,"previous_names":["i365dev/agent_forge"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i365dev%2Fagent_forge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i365dev%2Fagent_forge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i365dev%2Fagent_forge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i365dev%2Fagent_forge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i365dev","download_url":"https://codeload.github.com/i365dev/agent_forge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251895479,"owners_count":21661345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["adaptive-systems","agent","dsl","dynamic-workflows","elixir","workflow"],"created_at":"2025-03-30T21:23:49.355Z","updated_at":"2025-05-01T15:08:36.625Z","avatar_url":"https://github.com/i365dev.png","language":"Elixir","readme":"# AgentForge\n\n[![CI](https://github.com/i365dev/agent_forge/actions/workflows/ci.yml/badge.svg)](https://github.com/i365dev/agent_forge/actions/workflows/ci.yml)\n[![Hex.pm](https://img.shields.io/hexpm/v/agent_forge.svg)](https://hex.pm/packages/agent_forge)\n[![Docs](https://img.shields.io/badge/hex-docs-blue.svg)](https://hexdocs.pm/agent_forge)\n[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/i365dev/agent_forge/blob/main/LICENSE)\n\nAgentForge is a lightweight, signal-driven workflow framework for Elixir, designed for building flexible and maintainable data processing pipelines.\n\n```mermaid\ngraph TB\n    Signal[Signal] --\u003e Handler[Handler]\n    Handler --\u003e Store[Store]\n    Handler --\u003e Flow[Flow]\n    Flow --\u003e Runtime[Runtime]\n```\n\n## Features\n\n- 🔄 **Signal-driven Architecture**: Build workflows around immutable signals\n- 🧩 **Composable Primitives**: Core building blocks for common patterns\n- 🔀 **Flexible Flows**: Chain handlers into dynamic processing pipelines\n- 📦 **State Management**: Track and update workflow state\n- ⚡ **Async Support**: Handle asynchronous operations\n- 🛠 **Configuration-based**: Define workflows in YAML\n- 💪 **Type-safe**: Leverages Elixir's pattern matching\n- 🔌 **Plugin System**: Extend functionality with custom plugins\n\n## Quick Start\n\n```elixir\n# Add to mix.exs\ndef deps do\n  [\n    {:agent_forge, \"~\u003e 0.2.2\"}\n  ]\nend\n\n# Run\nmix deps.get\n```\n\n\u003e **Note**: AgentForge 0.2.2 introduces enhanced flow control features! See the [Flow Control Guide](guides/flow_control.md) for more details.\n\n### Simple Example\n\n```elixir\ndefmodule Example do\n  alias AgentForge.{Flow, Signal, Primitives}\n\n  def run do\n    # Define workflow steps\n    validate = Primitives.transform(fn data -\u003e\n      if data.valid?, do: data, else: raise \"Invalid data\"\n    end)\n\n    process = Primitives.transform(fn data -\u003e\n      Map.put(data, :processed, true)\n    end)\n\n    notify = Primitives.notify(\n      [:console],\n      format: \u0026(\"Processed: #{inspect(\u00261)}\")\n    )\n\n    # Compose workflow\n    workflow = [validate, process, notify]\n\n    # Execute\n    signal = Signal.new(:start, %{valid?: true})\n    {:ok, result, _state} = Flow.process(workflow, signal, %{})\n    IO.inspect(result)\n  end\nend\n```\n\n## Core Components\n\n### Signals\nImmutable messages that flow through the system:\n```elixir\nsignal = Signal.new(:user_action, %{id: 1})\n```\n\n### Primitives\nBuilding blocks for common patterns:\n- **Branch**: Conditional processing\n- **Transform**: Data modification\n- **Loop**: Iteration handling\n- **Wait**: Async operations\n- **Notify**: Event notifications\n\n### Flows\nCompose handlers into pipelines:\n```elixir\nworkflow = [\u0026validate/2, \u0026process/2, \u0026notify/2]\n```\n\n## Execution Limits\n\nAgentForge now supports execution limits for flows to prevent long-running processes:\n\n```elixir\n# Create a handler\nhandler = fn signal, state -\u003e\n  # Processing logic...\n  {{:emit, Signal.new(:done, result)}, state}\nend\n\n# Apply timeout limit\n{:ok, result, state} = AgentForge.process_with_limits(\n  [handler], \n  signal, \n  %{}, \n  timeout_ms: 5000  # Execution limited to 5 seconds\n)\n\n# Get execution statistics in the result\n{:ok, result, state, stats} = AgentForge.process_with_limits(\n  [handler], \n  signal, \n  %{}, \n  return_stats: true\n)\n\n# Or retrieve the last execution statistics afterwards\nstats = AgentForge.get_last_execution_stats()\n```\n\nThe execution limits feature supports the following options:\n- `timeout_ms`: Maximum execution time in milliseconds (default: `30000`)\n- `collect_stats`: Whether to collect execution statistics (default: `true`)\n- `return_stats`: Whether to include statistics in the return value (default: `false`)\n\nSee the documentation for more details.\n\n## Documentation\n\n- [AgentForge Design Philosophy \u0026 Architecture Guide](guides/design_guide.md)\n- [Getting Started Guide](guides/getting_started.md)\n- [Core Concepts](guides/core_concepts.md)\n- [Contribution Guidelines](CONTRIBUTING.md)\n\n## Examples\n\n- [Data Processing](examples/data_processing.exs): Basic data transformation pipeline\n- [Async Workflow](examples/async_workflow.exs): Handling async operations\n- [Configuration-based](examples/config_workflow.exs): YAML-defined workflows\n- [Flow Control](examples/enhanced_flow_control.exs): Advanced flow control features\n- [Limited Workflow](examples/limited_workflow.exs): Execution limits example\n- [Plugin System](examples/plugin_system.exs): Plugin system example\n\n## Design Philosophy\n\nAgentForge focuses on:\n- **Simplicity**: Clean, understandable codebase\n- **Flexibility**: Adaptable to various use cases\n- **Maintainability**: Well-documented, tested code\n- **Composability**: Build complex flows from simple parts\n\n## Use Cases\n\n- ✅ Data Processing Pipelines\n- ✅ Event-driven Workflows\n- ✅ Multi-step Validations\n- ✅ Async Task Orchestration\n- ✅ Business Process Automation\n\n## Development\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/USERNAME/agent_forge.git\ncd agent_forge\n\n# Get dependencies\nmix deps.get\n\n# Run tests\nmix test\n\n# Generate documentation\nmix docs\n```\n\n### Pre-release Checklist\n\n- [ ] All tests pass (`mix test`)\n- [ ] Test coverage is acceptable (`mix coveralls.html` - check coverage/excoveralls.html)\n- [ ] Code is formatted (`mix format`)\n- [ ] Documentation generates without errors (`mix docs`)\n- [ ] Version number is correct in mix.exs\n- [ ] CHANGELOG.md is updated\n- [ ] GitHub Actions workflows are in place\n- [ ] All examples run without errors\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for guidelines.\n\n1. Read the [AgentForge Design Philosophy \u0026 Architecture Guide](guides/design_guide.md)\n2. Fork the repository\n3. Create your feature branch (`git checkout -b feature/amazing-feature`)\n4. Run the tests (`mix test`)\n5. Commit your changes (`git commit -m 'Add some amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":["后端开发框架及项目"],"sub_categories":["后端项目_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi365dev%2Fagent_forge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi365dev%2Fagent_forge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi365dev%2Fagent_forge/lists"}