Skip to content

Releases: GlyphyAI/liteswarm

0.6.0

21 Jan 22:04

Choose a tag to compare

What's Changed

Core Improvements

  • Introduced type-safe context validation with generic AgentContext[ContextParams, AgentOutput]
  • Added new tool registration system with @tool and @tool_plain decorators
  • Implemented type validation for SwarmStream and Swarm public API
  • Added explicit agent switching via ToolResult.switch_to method

Developer Experience

  • Unified chat components with new ChatContext for simpler state management
  • Reorganized examples into basics and advanced categories
  • Added new examples for structured outputs and agent teams
  • Enhanced documentation with type-safe API usage examples

Breaking Changes

  • Core API now requires type parameters for context and output validation
  • Agent switching requires explicit ToolResult.switch_to calls
  • Chat components use unified ChatContext instead of separate managers
  • Removed experimental SwarmTeam prototype module

Migration Notes

# Before - Generic agent context
agent = Agent(id="math", instructions="You are a math assistant.")
context = AgentContext(agent=agent, messages=messages)

# After - Type-safe context
class MathParams(BaseModel):
    precision: int

class MathResult(BaseModel):
    result: int
    explanation: str

agent = Agent[MathParams, MathResult](
    id="math",
    instructions="You are a math assistant.",
    params_type=MathParams,
    result_type=MathResult,
)
context = AgentContext(
    agent=agent,
    messages=messages,
    params=MathParams(precision=2),
)

# Before - Implicit agent switching
def switch_to_expert(context: AgentContext) -> Agent:
    return Agent(id="expert", instructions="You are an expert.")

# After - Explicit agent switching
@tool_plain
def switch_to_expert(domain: str) -> ToolResult:
    expert = Agent[ExpertParams, None](
        id=f"{domain}-expert",
        instructions=f"You are a {domain} expert.",
        params_type=ExpertParams,
    )
    return ToolResult.switch_to(
        content=f"Switching to {domain} expert",
        agent=expert,
        params=ExpertParams(domain=domain),
    )

Removed

  • Experimental SwarmTeam prototype module
  • Generic message types in favor of type-safe alternatives
  • Swarm team types and exceptions

Contributors

Thanks to:

Full Changelog: 0.5.1...0.6.0

0.5.1

21 Jan 22:03

Choose a tag to compare

What's Changed

Improvements

  • Added missing common types (LLM, ContextVariables, etc) to global namespace

Bug Fixes

  • Resolved mypy type variance issues with generic types

Contributors

Thanks to:

Full Changelog: 0.5.0...0.5.1

0.5.0

21 Jan 22:03

Choose a tag to compare

What's Changed

Core Improvements

  • Reworked core Swarm API to be fully stateless for better composability
  • Added type-safe structured outputs with Pydantic model support
  • Implemented new events for managing agent flow (activate, begin, complete, response)
  • Added TypeVar type checking trick for Pydantic bound generics
  • Introduced parse response method for handling partial/full agent responses

Developer Experience

  • Added chat components built on top of Swarm and SwarmTeam
  • Simplified field names and event model naming for consistency
  • Improved type safety around response formats
  • Added new examples showcasing chat and team chat functionality
  • Enhanced documentation with stateless architecture examples

Breaking Changes

  • Swarm is now fully stateless - state management moved to Chat components
  • SwarmTeam redesigned to be stateless with streaming API support
  • Event handling requires using new event types
  • get_result renamed to get_return_value for ReturnableAsyncGenerator

Migration Notes

# Before - Stateful Swarm
swarm = Swarm()
swarm.add_message(Message(role="user", content="Hello"))
result = await swarm.execute(agent)

# After - Stateless Swarm with Chat
chat = LiteChat()
stream = chat.send_message("Hello", agent=agent)
result = await stream.get_return_value()

# Before - Stateful SwarmTeam
team = SwarmTeam(swarm=swarm, members=members, task_definitions=task_definitions)
session = await team.create_session()
result = await session.execute_plan(plan)

# After - Stateless SwarmTeam with Chat
team_chat = LiteTeamChat(swarm=swarm, members=members, task_definitions=task_definitions)
stream = team_chat.send_message("Create a web app")
result = await stream.get_return_value()

Removed

  • Obsolete MessageStore, ContextManager, EventHandler components
  • Redundant unwrap utils and ambiguous messages file
  • Deprecated types and components
  • Session management from chat components

Contributors

Thanks to:

Full Changelog: 0.4.0...0.5.0

0.4.0

26 Dec 18:44

Choose a tag to compare

What's Changed

Core Improvements

  • Introduced ReturnableAsyncGenerator for unified event streaming API
  • Added RAG strategy configuration type for context optimization control
  • Added tool call result field for improved result handling
  • Implemented serialization support for agent instructions and LLM tools

Developer Experience

  • Refactored event streaming architecture with cleaner separation of concerns
  • Embedded completion response into agent response model
  • Simplified event types by removing redundant "Swarm" prefix
  • Enhanced documentation with up-to-date streaming examples
  • Updated event handler to use new streaming API

Breaking Changes

  • Removed SwarmStream module in favor of ReturnableAsyncGenerator
  • Removed redundant tool call event in favor of result-only events
  • Event handling now requires handling event types instead of direct responses
  • Streaming API now yields events instead of response chunks

Migration Notes

# Before
stream = swarm.stream(agent, prompt="Hello")
async for response in stream:
    print(response.delta.content)

# After
stream = swarm.stream(agent, prompt="Hello")
async for event in stream:
    if event.type == "agent_response_chunk":
        print(event.chunk.completion.delta.content)

Contributors

Thanks to:

Full Changelog: 0.3.0...0.4.0

0.3.0

23 Dec 19:44

Choose a tag to compare

What's Changed

Core Improvements

  • Added async interface to MessageStore for better I/O performance
  • Introduced batch operations for message management (add_messages, remove_messages)
  • Unified ContextManager interface with create/optimize/find methods
  • Enhanced usage and cost tracking with proper accumulation

Developer Experience

  • Renamed response types to better reflect streaming nature (AgentResponseChunk)
  • Updated event types to match new response chunk naming convention
  • Improved context management with centralized data access
  • Enhanced documentation with updated examples and protocols

Bug Fixes

  • Fixed usage statistics accumulation in streaming responses

Breaking Changes

  • Renamed AgentResponse to AgentResponseChunk
  • Renamed CompletionResponse to CompletionResponseChunk
  • Updated event types to use new chunk naming
  • MessageStore methods now require async/await

Contributors

Thanks to:

Full Changelog: 0.2.0...0.3.0

0.2.0

20 Dec 16:35

Choose a tag to compare

What's Changed

Core Improvements

  • Added message management system with MessageStore, MessageIndex, and ContextManager
  • Introduced event system with ConsoleEventHandler and SwarmEventHandler
  • Added SwarmStream wrapper for improved response handling
  • Enhanced error handling with retry mechanisms and backoff strategies

Developer Experience

  • Added new REPL commands for optimization and search
  • Improved type system with stricter checks
  • Enhanced message and context management
  • Updated examples to use new event system

Bug Fixes

  • Fixed context update and retry mechanism issues
  • Improved tool call pair filtering
  • Enhanced response format handling
  • Fixed variable initialization and error logging

Cleanup

  • Removed legacy stream handler and summarizer
  • Cleaned up unused types and context keys

Contributors

Thanks to:

Full Changelog: 0.1.1...0.2.0

0.1.1

09 Dec 23:26

Choose a tag to compare

What's Changed

  • Add the py.typed file to make the package PEP 561 compliant, ensuring full support for type checkers like mypy

Contributors

Thanks to:

Full Changelog: 0.1.0...0.1.1

0.1.0

09 Dec 23:07

Choose a tag to compare

What's Changed

  • Initial release of LiteSwarm framework
  • Core agent system with LLM-agnostic design
  • Experimental SwarmTeam for multi-agent orchestration
  • Structured outputs with OpenAI compatibility
  • Comprehensive examples and documentation

Contributors

Thanks to:

Full Changelog: https://github.com/GlyphyAI/liteswarm/commits/0.1.0