Framework · Orchestration Frameworks

GPTSwarm

Represent LLM-based agents and their connections as optimizable graphs whose edges and prompts are tuned automatically toward better swarm performance.

Description

GPTSwarm is a graph-based framework for LLM-based agents. It builds agents from computational graphs and connects them into swarms whose inter-agent edges can be pruned or created at run time. The framework includes optimization algorithms that tune prompts and the graph itself toward better task performance. It is written in Python and released under the MIT license; the underlying work was published as 'Language Agents as Optimizable Graphs' and accepted at ICML 2024.

Solution

Agents are constructed as graphs of operations and connected into a swarm; an optimizer adjusts the inter-agent edges and prompts against an evaluation signal, pruning or creating connections so the collaboration structure is learned rather than fixed.

Primary use cases

  • building LLM agents from computational graphs
  • optimizing inter-agent connections at run time
  • automatically tuning agent prompts and swarm topology

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.