Skip to content

.NET: Inconsistency of message ordering when using AIContextProvider #2655

@stekiri

Description

@stekiri

Maybe I am mistaken and there is something that I am missing, but currently it appears when using an AIContextProvider, the message order is different when sending it to the chat client vs when sending it to the message store.

Let's say, we have two messages in the message store already:

Message Store:

  1. Message A
  2. Message B

Then we invoke the agent another time with Message C.

Let's assume the ContextProvider injects Message X.

The following messages are sent to the chat client (see PrepareThreadAndMessagesAsync method):

  1. Message A
  2. Message B
  3. Message X
  4. Message C

The chat client returns Message D.

However, the messages are then stored in the following order in the message store (see invokation of NotifyMessageStoreOfNewMessagesAsync

  1. Message C
  2. Message X
  3. Message D

Metadata

Metadata

Labels

.NETagent memoryRelated to agentic memoryv1.0Features being tracked for the version 1.0 GA

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions