Changelog

Track the latest improvements, features, and fixes to AGNT5.

Agent Memory and Context Management

Agents now maintain durable conversation history across sessions with intelligent context window management. No more context loss when conversations span days or exceed token limits.

Automatic Context Summarization

When conversation history approaches the LLM’s token limit, AGNT5 automatically summarizes older messages while preserving recent exchanges verbatim:

@agent()
class SupportAgent:
    async def handle_message(self, user_id: str, message: str):
        # Context automatically managed
        response = await self.chat(message)
        return response

The agent maintains full conversation history in durable storage. Recent messages stay intact for immediate context. Older messages get compressed through summarization. The LLM sees a seamless conversation thread that fits within token limits.

Why Context Matters

Long-running agent conversations — customer support, research assistants, coding copilots — require persistent memory. Users expect agents to remember previous interactions, not restart from scratch each session.

With automatic context management, your agents scale to conversations of any length. The complexity of token counting, summarization, and history management becomes invisible.

Read the agent documentation for implementation details.

Python SDK: Type-Safe Entity State

Entity state management now supports Python’s TypedDict, bringing full type safety and IDE autocomplete to your durable entities.

The Problem

Previously, entity state was untyped — a plain dictionary that could hold any structure. This worked, but required manual validation and provided no IDE support:

@entity()
class UserSession:
    async def update_preferences(self, key: str, value: any):
        # What fields exist in self.state? No autocomplete to help.
        self.state[key] = value

The Solution

Define your state structure with TypedDict, and the SDK enforces it at runtime:

from typing import TypedDict

class SessionState(TypedDict):
    user_id: str
    preferences: dict[str, str]
    last_active: int

@entity()
class UserSession:
    state: SessionState

    async def update_preference(self, key: str, value: str):
        # Full autocomplete on self.state.preferences
        self.state["preferences"][key] = value

Type checking happens automatically. Invalid state updates fail fast with clear error messages. Your IDE provides autocomplete for all state fields.

Read the entity documentation to learn more about type-safe state management.

Improved Workflow State Persistence

When workflows span hours or days, state persistence becomes critical. This release strengthens AGNT5’s checkpoint recovery system to handle complex state transitions more reliably.

What Changed

We’ve redesigned how workflow state gets persisted during execution. Previously, checkpoints were created after each function invocation. Now, checkpoints capture the complete workflow context — including local variables, pending tasks, and execution history.

@workflow()
async def research_pipeline(topic: str):
    # Checkpoint created here with full context
    sources = await gather_sources(topic)

    # If failure occurs here, workflow resumes with sources intact
    summaries = await summarize_sources(sources)

    return await synthesize_report(summaries)

This means when a workflow resumes after a failure, it picks up exactly where it left off. No re-execution of completed steps. No lost progress.

Why This Matters

Long-running AI workflows often fail mid-execution — API timeouts, rate limits, infrastructure issues. With enhanced checkpoint recovery, these failures no longer mean starting over.

Your workflows become truly durable. Pause them. Resume them. Replay them with different code. The execution history is the source of truth.

Learn more in the workflow documentation.