Duurzame taakextensie voor Microsoft Agent Framework (preview)

De Durable Task-extensie voor Microsoft Agent Framework brengt duurzame uitvoering rechtstreeks in het Microsoft Agent Framework. U kunt agents registreren bij de extensie om ze automatisch duurzaam te maken met permanente sessies, ingebouwde API-eindpunten en gedistribueerd schalen, zonder wijzigingen in uw agentlogica.

De extensie implementeert intern op entiteiten gebaseerde agentlussen, waarbij elke agentsessie een duurzame entiteit is waarmee de gespreksstatus en controlepunten automatisch worden beheerd.

De extensie ondersteunt twee hostingmethoden:

  • Azure Functions met behulp van het Azure Functions-integratiepakket.
  • Bring Your Own Compute met het basispakket.

Agenthosting

Definieer uw agent met behulp van het standaardpatroon Microsoft Agent Framework en verbeter deze vervolgens met de durable task-extensie. De extensie verwerkt sessiepersistentie, het maken van eindpunten en statusbeheer automatisch.

var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")
    ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")
    ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set.");

AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
    .GetChatClient(deploymentName)
    .AsAIAgent(
        instructions: "You are a professional content writer who creates engaging, "
                    + "well-structured documents for any given topic.",
        name: "DocumentPublisher");

// One line to make the agent durable with serverless hosting
using IHost app = FunctionsApplication
    .CreateBuilder(args)
    .ConfigureFunctionsWebApplication()
    .ConfigureDurableAgents(options => options.AddAIAgent(agent))
    .Build();
app.Run();
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")
    ?? throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")
    ?? throw new InvalidOperationException("AZURE_OPENAI_DEPLOYMENT_NAME is not set.");

AIAgent agent = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
    .GetChatClient(deploymentName)
    .AsAIAgent(
        instructions: "You are a professional content writer who creates engaging, "
                    + "well-structured documents for any given topic.",
        name: "DocumentPublisher");

// Host the agent with Durable Task Scheduler
string connectionString = "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.ConfigureDurableAgents(
            options => options.AddAIAgent(agent),
            workerBuilder: builder => builder.UseDurableTaskScheduler(connectionString),
            clientBuilder: builder => builder.UseDurableTaskScheduler(connectionString));
    })
    .Build();

await host.StartAsync();

Multi-agentenorchestratie

U kunt meerdere gespecialiseerde agents coördineren als stappen in een duurzame orchestratie. Elke agentoproep wordt gecontroleerd en de indeling wordt automatisch hersteld als er een stap mislukt. Voltooide agent-aanroepen worden niet opnieuw uitgevoerd bij herstel.

In het volgende voorbeeld ziet u een werkstroom voor meerdere agents waarin een onderzoeksagent informatie verzamelt en een schrijveragent een document produceert.

[Function(nameof(DocumentPublishingOrchestration))]
public async Task<string> DocumentPublishingOrchestration(
    [OrchestrationTrigger] TaskOrchestrationContext context)
{
    var docRequest = context.GetInput<DocumentRequest>();

    DurableAIAgent researchAgent = context.GetAgent("ResearchAgent");
    DurableAIAgent writerAgent = context.GetAgent("DocumentPublisherAgent");

    // Step 1: Research the topic
    AgentResponse<ResearchResult> researchResult = await researchAgent
        .RunAsync<ResearchResult>(
            $"Research the following topic: {docRequest.Topic}");

    // Step 2: Write the document using the research findings
    AgentResponse<DocumentResponse> document = await writerAgent
        .RunAsync<DocumentResponse>(
            $"""Create a document about {docRequest.Topic}.
            Research findings: {researchResult.Result.Findings}""");

    // Step 3: Publish
    return await context.CallActivityAsync<string>(
        nameof(PublishDocument),
        new { docRequest.Topic, document.Result.Text });
}
static async Task<string> DocumentPublishingOrchestration(
    TaskOrchestrationContext context, DocumentRequest docRequest)
{
    DurableAIAgent researchAgent = context.GetAgent("ResearchAgent");
    DurableAIAgent writerAgent = context.GetAgent("DocumentPublisherAgent");

    // Step 1: Research the topic
    AgentResponse<ResearchResult> researchResult = await researchAgent
        .RunAsync<ResearchResult>(
            $"Research the following topic: {docRequest.Topic}");

    // Step 2: Write the document using the research findings
    AgentResponse<DocumentResponse> document = await writerAgent
        .RunAsync<DocumentResponse>(
            $"""Create a document about {docRequest.Topic}.
            Research findings: {researchResult.Result.Findings}""");

    // Step 3: Publish
    return await context.CallActivityAsync<string>(
        nameof(PublishDocument),
        new { docRequest.Topic, document.Result.Text });
}

Op grafieken gebaseerde werkstromen

De Durable Task-extensie ondersteunt ook Microsoft Agent Framework-werkstromen, die gebruikmaken van een declaratief programmeermodel op basis van grafieken (WorkflowBuilder) om pijplijnen met meerdere stappen van uitvoerders en agents te definiëren. De extensie controleert automatisch elke stap in de grafiek en herstelt fouten zonder wijzigingen in de werkstroomdefinitie.

Sequentiële werkstroom

In het volgende voorbeeld worden drie uitvoerders gekoppeld aan een werkstroom voor orderannulering: zoek de bestelling op, annuleer deze en stuur vervolgens een bevestigingsmail.

OrderLookup orderLookup = new();
OrderCancel orderCancel = new();
SendEmail sendEmail = new();

Workflow cancelOrder = new WorkflowBuilder(orderLookup)
    .WithName("CancelOrder")
    .WithDescription("Cancel an order and notify the customer")
    .AddEdge(orderLookup, orderCancel)
    .AddEdge(orderCancel, sendEmail)
    .Build();

using IHost app = FunctionsApplication
    .CreateBuilder(args)
    .ConfigureFunctionsWebApplication()
    .ConfigureDurableWorkflows(workflows => workflows.AddWorkflows(cancelOrder))
    .Build();
app.Run();

De OrderLookup, OrderCancel en SendEmail executors zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING")
    ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

OrderLookup orderLookup = new();
OrderCancel orderCancel = new();
SendEmail sendEmail = new();

Workflow cancelOrder = new WorkflowBuilder(orderLookup)
    .WithName("CancelOrder")
    .WithDescription("Cancel an order and notify the customer")
    .AddEdge(orderLookup, orderCancel)
    .AddEdge(orderCancel, sendEmail)
    .Build();

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.ConfigureDurableWorkflows(
            workflowOptions => workflowOptions.AddWorkflow(cancelOrder),
            workerBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString),
            clientBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString));
    })
    .Build();

await host.StartAsync();

IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
IAwaitableWorkflowRun run = (IAwaitableWorkflowRun)await workflowClient.RunAsync(cancelOrder, "ORD-12345");
string? result = await run.WaitForCompletionAsync<string>();

De OrderLookup, OrderCancel en SendEmail executors zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

Fan-out/fan-in -werkstroom (gelijktijdig)

U kunt taken verdelen over meerdere uitvoerders of agents die parallel worden uitgevoerd en vervolgens de resultaten verzamelen. In het volgende voorbeeld wordt een wetenschapsvraag parallel naar een fysicus en chemicus verzonden, waarna de reacties worden samengevoegd.

ChatClient chatClient = new AzureOpenAIClient(
    new Uri(endpoint), new DefaultAzureCredential()).GetChatClient(deploymentName);

AIAgent physicist = chatClient.AsAIAgent(
    "You are a physics expert. Be concise (2-3 sentences).", "Physicist");
AIAgent chemist = chatClient.AsAIAgent(
    "You are a chemistry expert. Be concise (2-3 sentences).", "Chemist");

ParseQuestionExecutor parseQuestion = new();
AggregatorExecutor aggregator = new();

Workflow workflow = new WorkflowBuilder(parseQuestion)
    .WithName("ExpertReview")
    .AddFanOutEdge(parseQuestion, [physicist, chemist])
    .AddFanInBarrierEdge([physicist, chemist], aggregator)
    .Build();

using IHost app = FunctionsApplication
    .CreateBuilder(args)
    .ConfigureFunctionsWebApplication()
    .ConfigureDurableWorkflows(workflows => workflows.AddWorkflows(workflow))
    .Build();
app.Run();

De ParseQuestionExecutor en AggregatorExecutor zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING")
    ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

ChatClient chatClient = new AzureOpenAIClient(
    new Uri(endpoint), new DefaultAzureCredential()).GetChatClient(deploymentName);

ParseQuestionExecutor parseQuestion = new();
AIAgent physicist = chatClient.AsAIAgent(
    "You are a physics expert. Be concise (2-3 sentences).", "Physicist");
AIAgent chemist = chatClient.AsAIAgent(
    "You are a chemistry expert. Be concise (2-3 sentences).", "Chemist");
AggregatorExecutor aggregator = new();

Workflow workflow = new WorkflowBuilder(parseQuestion)
    .WithName("ExpertReview")
    .AddFanOutEdge(parseQuestion, [physicist, chemist])
    .AddFanInBarrierEdge([physicist, chemist], aggregator)
    .Build();

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.ConfigureDurableOptions(
            options => options.Workflows.AddWorkflow(workflow),
            workerBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString),
            clientBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString));
    })
    .Build();

await host.StartAsync();

IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
IWorkflowRun run = await workflowClient.RunAsync(workflow, "Why is the sky blue?");

if (run is IAwaitableWorkflowRun awaitableRun)
{
    string? result = await awaitableRun.WaitForCompletionAsync<string>();
    Console.WriteLine(result);
}

De ParseQuestionExecutor en AggregatorExecutor zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

Werkstroom voor voorwaardelijke routering

U kunt de uitvoering routeren naar verschillende vertakkingen op basis van runtimeresultaten. In het volgende voorbeeld wordt een spamdetectieagent gebruikt om binnenkomende e-mail te classificeren en wordt vervolgens gerouteerd naar een spamhandler of een e-mailassistentagent.

AIAgent spamDetector = chatClient.AsAIAgent(
    "You are a spam detection assistant. Return JSON with is_spam (bool) and reason (string).",
    "SpamDetectionAgent");
AIAgent emailAssistant = chatClient.AsAIAgent(
    "You are an email assistant. Draft a professional response.",
    "EmailAssistantAgent");

SpamHandlerExecutor spamHandler = new();
EmailSenderExecutor emailSender = new();

Workflow workflow = new WorkflowBuilder(spamDetector)
    .WithName("EmailClassification")
    .AddSwitchCaseEdgeGroup(spamDetector, [
        new Case(condition: IsSpamDetected, target: spamHandler),
        new Default(target: emailAssistant),
    ])
    .AddEdge(emailAssistant, emailSender)
    .Build();

using IHost app = FunctionsApplication
    .CreateBuilder(args)
    .ConfigureFunctionsWebApplication()
    .ConfigureDurableWorkflows(workflows => workflows.AddWorkflows(workflow))
    .Build();
app.Run();

De SpamHandlerExecutor en EmailSenderExecutor zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING")
    ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

ChatClient chatClient = new AzureOpenAIClient(
    new Uri(endpoint), new DefaultAzureCredential()).GetChatClient(deploymentName);

AIAgent spamDetector = chatClient.AsAIAgent(
    "You are a spam detection assistant. Return JSON with is_spam (bool) and reason (string).",
    "SpamDetectionAgent");
AIAgent emailAssistant = chatClient.AsAIAgent(
    "You are an email assistant. Draft a professional response.",
    "EmailAssistantAgent");

SpamHandlerExecutor spamHandler = new();
EmailSenderExecutor emailSender = new();

Workflow workflow = new WorkflowBuilder(spamDetector)
    .WithName("EmailClassification")
    .AddSwitchCaseEdgeGroup(spamDetector, [
        new Case(condition: IsSpamDetected, target: spamHandler),
        new Default(target: emailAssistant),
    ])
    .AddEdge(emailAssistant, emailSender)
    .Build();

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.ConfigureDurableWorkflows(
            workflowOptions => workflowOptions.AddWorkflow(workflow),
            workerBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString),
            clientBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString));
    })
    .Build();

await host.StartAsync();

IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
IAwaitableWorkflowRun run = (IAwaitableWorkflowRun)await workflowClient.RunAsync(workflow, "Check this email for spam");
string? result = await run.WaitForCompletionAsync<string>();

De SpamHandlerExecutor en EmailSenderExecutor zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

HITL-werkstroom (Human-in-the-loop)

U kunt de uitvoering van de werkstroom onderbreken op aangewezen punten om te wachten op externe invoer voordat u doorgaat. Het Microsoft Agent Framework-werkstroommodel maakt gebruik van RequestPort-knooppunten (in .NET) of ctx.request_info() (in Python) om onderbrekingspunten te definiëren. In het volgende voorbeeld wordt een werkstroom voor onkostenvergoeding geïmplementeerd met een goedkeuring van een manager, gevolgd door parallelle budget- en nalevingsgoedkeuringen.

CreateApprovalRequest createRequest = new();
RequestPort<ApprovalRequest, ApprovalResponse> managerApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("ManagerApproval");
PrepareFinanceReview prepareFinanceReview = new();
RequestPort<ApprovalRequest, ApprovalResponse> budgetApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("BudgetApproval");
RequestPort<ApprovalRequest, ApprovalResponse> complianceApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("ComplianceApproval");
ExpenseReimburse reimburse = new();

Workflow expenseApproval = new WorkflowBuilder(createRequest)
    .WithName("ExpenseReimbursement")
    .WithDescription("Expense reimbursement with manager and parallel finance approvals")
    .AddEdge(createRequest, managerApproval)
    .AddEdge(managerApproval, prepareFinanceReview)
    .AddFanOutEdge(prepareFinanceReview, [budgetApproval, complianceApproval])
    .AddFanInBarrierEdge([budgetApproval, complianceApproval], reimburse)
    .Build();

using IHost app = FunctionsApplication
    .CreateBuilder(args)
    .ConfigureFunctionsWebApplication()
    .ConfigureDurableWorkflows(workflows =>
        workflows.AddWorkflow(expenseApproval, exposeStatusEndpoint: true))
    .Build();
app.Run();

Het framework genereert automatisch drie HTTP-eindpunten voor HITL-interactie.

  • POST /api/workflows/{name}/run : De werkstroom starten
  • GET /api/workflows/{name}/status/{id} : Status en in behandeling zijnde goedkeuringen controleren
  • POST /api/workflows/{name}/respond/{id} : Goedkeuringsantwoord verzenden om te hervatten

De volgende recordtypen definiëren de gegevens die via de werkstroom stromen:

public record ApprovalRequest(string ExpenseId, decimal Amount, string EmployeeName);
public record ApprovalResponse(bool Approved, string? Comments);

De CreateApprovalRequest, PrepareFinanceReview en ExpenseReimburse executors zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

string dtsConnectionString = Environment.GetEnvironmentVariable("DURABLE_TASK_SCHEDULER_CONNECTION_STRING")
    ?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

CreateApprovalRequest createRequest = new();
RequestPort<ApprovalRequest, ApprovalResponse> managerApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("ManagerApproval");
PrepareFinanceReview prepareFinanceReview = new();
RequestPort<ApprovalRequest, ApprovalResponse> budgetApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("BudgetApproval");
RequestPort<ApprovalRequest, ApprovalResponse> complianceApproval =
    RequestPort.Create<ApprovalRequest, ApprovalResponse>("ComplianceApproval");
ExpenseReimburse reimburse = new();

Workflow expenseApproval = new WorkflowBuilder(createRequest)
    .WithName("ExpenseReimbursement")
    .AddEdge(createRequest, managerApproval)
    .AddEdge(managerApproval, prepareFinanceReview)
    .AddFanOutEdge(prepareFinanceReview, [budgetApproval, complianceApproval])
    .AddFanInBarrierEdge([budgetApproval, complianceApproval], reimburse)
    .Build();

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.ConfigureDurableWorkflows(
            options => options.AddWorkflow(expenseApproval),
            workerBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString),
            clientBuilder: builder => builder.UseDurableTaskScheduler(dtsConnectionString));
    })
    .Build();

await host.StartAsync();

IWorkflowClient workflowClient = host.Services.GetRequiredService<IWorkflowClient>();
IStreamingWorkflowRun run = await workflowClient.StreamAsync(expenseApproval, "EXP-2025-001");

await foreach (WorkflowEvent evt in run.WatchStreamAsync())
{
    switch (evt)
    {
        case DurableWorkflowWaitingForInputEvent requestEvent:
            Console.WriteLine($"Workflow paused at: {requestEvent.RequestPort.Id}");
            ApprovalResponse approval = new(Approved: true, Comments: "Approved.");
            await run.SendResponseAsync(requestEvent, approval);
            break;

        case DurableWorkflowCompletedEvent completedEvent:
            Console.WriteLine($"Workflow completed: {completedEvent.Result}");
            break;
    }
}

De volgende recordtypen definiëren de gegevens die via de werkstroom stromen:

public record ApprovalRequest(string ExpenseId, decimal Amount, string EmployeeName);
public record ApprovalResponse(bool Approved, string? Comments);

De CreateApprovalRequest, PrepareFinanceReview en ExpenseReimburse executors zijn standaard Microsoft Agent Framework-uitvoerders zonder duurzame code. Zie de samples op GitHub voor volledige implementaties.

Dashboard voor Durable Task Scheduler

Gebruik het dashboard Durable Task Scheduler voor volledige zichtbaarheid van uw duurzame agents, indelingen en op grafieken gebaseerde werkstromen:

  • Gespreksgeschiedenis voor elke agentsessie weergeven
  • Hulpprogramma-aanroepen en gestructureerde uitvoer controleren
  • Orchestratie- en werkstroomuitvoeringstromen traceren
  • Metrische prestatiegegevens monitoren

Zowel lokale ontwikkeling (via de emulator) als productie-implementaties bieden dezelfde dashboardervaring.

In de volgende schermopname ziet u een agentsessie met de gespreksgeschiedenis en sessiedetails:

Schermopname van het dashboard Durable Task Scheduler met de gespreksgeschiedenis en sessiedetails van de agent.

In de volgende schermopname ziet u een deterministische indeling met details van de uitvoering van activiteiten:

Schermopname van het Durable Task Scheduler-dashboard dat een deterministische agentieke orkestratieweergave toont.

Sessietime-to-live (TTL)

Duurzame agentsessies onderhouden automatisch de gespreksgeschiedenis en -status, die voor onbepaalde tijd kunnen worden verzameld. De time-to-live-functie (TTL) biedt automatisch opschonen van niet-actieve sessies, waardoor het verbruik van opslagresources en hogere kosten worden voorkomen.

Wanneer een agentsessie langer inactief is dan de geconfigureerde TTL-periode, wordt de sessiestatus automatisch verwijderd. Elke nieuwe interactie stelt de TTL-timer opnieuw in, waardoor de levensduur van de sessie wordt verlengd.

Standaardwaarden

  • Standaard-TTL: 14 dagen
  • Minimale TTL-verwijderingsvertraging: 5 minuten

Configuratie

TTL kan globaal of per agent worden geconfigureerd. Wanneer een agentsessie verloopt, wordt de volledige status verwijderd, inclusief gespreksgeschiedenis en eventuele aangepaste statusgegevens. Als er na verwijdering een bericht naar dezelfde sessie wordt verzonden, wordt er een nieuwe sessie gemaakt met een nieuwe gespreksgeschiedenis.

Opmerking

TTL-configuratie is momenteel alleen beschikbaar in .NET.

services.ConfigureDurableAgents(
    options =>
    {
        // Set global default TTL to 7 days
        options.DefaultTimeToLive = TimeSpan.FromDays(7);

        // Agent with custom TTL of 1 day
        options.AddAIAgent(shortLivedAgent, timeToLive: TimeSpan.FromDays(1));

        // Agent with custom TTL of 90 days
        options.AddAIAgent(longLivedAgent, timeToLive: TimeSpan.FromDays(90));

        // Agent using global default (7 days)
        options.AddAIAgent(defaultAgent);

        // Agent with no TTL (never expires)
        options.AddAIAgent(permanentAgent, timeToLive: null);
    });

Bekende beperkingen

  • Maximale gespreksgrootte.
    Sessiestatus van agent, inclusief de volledige gespreksgeschiedenis, is onderhevig aan de statusgroottelimieten van de duurzame back-end. Wanneer u de Durable Task Scheduler gebruikt, is de maximale grootte van de entiteitsstatus 1 MB. Langlopende gesprekken met antwoorden op grote oproepen van hulpprogramma's kunnen deze limiet bereiken. Het comprimeren van de gespreksgeschiedenis moet handmatig worden uitgevoerd, bijvoorbeeld door een nieuwe agentsessie te starten en de vorige context samen te vatten.

  • Latency.
    Alle agentinteracties worden gerouteerd via de Durable Task Scheduler, waardoor latentie wordt toegevoegd in vergelijking met de uitvoering van de in-memory agent. Dit compromis biedt duurzaamheid en gedistribueerde schaalbaarheid.

  • Streaming.
    Omdat duurzame agents worden geïmplementeerd op duurzame entiteiten, is het onderliggende communicatiemodel aanvraag/antwoord. Streaming wordt ondersteund via callbacks voor antwoorden (bijvoorbeeld het pushen van tokens naar een Redis Stream voor clientverbruik), terwijl de entiteit het volledige antwoord retourneert nadat de stream is voltooid.

  • TTL-verlooptijd.
    De TTL-timer is gebaseerd op wandkloktijd sinds het laatste bericht, niet de cumulatieve activiteitstijd. Zodra een sessie is verwijderd (via verlooptijd van TTL of handmatig verwijderen), kan de gespreksgeschiedenis niet meer worden hersteld.

Volgende stappen