v1.2.0
Added
AgentFrameworkOptions.ExposeMemoryToolsFromContextProvider— optional memory-tool exposure viaAIContext.Tools(#86).Neo4jMemoryContextProvidercan now surface the six standard memory tools (MemoryToolFactory.CreateAIFunctions()) itself throughAIContext.Tools, soAIContextProviders = [memoryProvider]alone is enough to give an agent LLM-callable memory tools — no separateChatOptions.Tools = [.. memoryTools]wiring required.
Defaults tofalse:AddAgentMemoryFrameworkregistersMemoryToolFactoryunconditionally, and its tools include write-capable ones (remember_fact,remember_preference), so exposure must stay opt-in rather than firing just because the factory is present in DI. EveryBuildContextAsyncbranch (a recall hit, an empty recall, a recall failure, or no user message at all) shares oneAIContext-construction helper, so tool availability never silently drops on a quiet turn.ContextFormatOptions.MaxChatHistoryMessages(#91, see Fixed below) — the new name for what wasMaxContextMessages.
Fixed
AddGraphRagAdapter()could never actually resolveIGraphRagContextSource—IDriverwas never registered in DI.Neo4jGraphRagContextSourcetakesIDrivervia constructor injection, butAddNeo4jAgentMemoryonly registeredINeo4jDriverFactory(which wrapsIDriverviaGetDriver()), neverIDriveritself. Any host that calledAddGraphRagAdapter()hitInvalidOperationException: Unable to resolve service for type 'Neo4j.Driver.IDriver'the first time GraphRAG retrieval ran — this broke the feature for every consumer, not just the sample that surfaced it. Fixed by registeringIDriverfrom the existingINeo4jDriverFactorysingleton inAddNeo4jAgentMemory.ContextFormatOptions.MaxContextMessagesrenamed toMaxChatHistoryMessages, old name kept as an[Obsolete]compatibility alias (#91). The option was documented as capping the complete injected context, but the implementation always preserved the context prefix and every memory-derived block (entities/facts/preferences/reasoning traces/GraphRAG) — only recalled chat history was ever truncated to fit. The renamed option's implementation now matches its name: it bounds only recalled chat history, independent of the prefix/memory-block count. Negative values are rejected by option validation;MaxChatHistoryMessages = 0means no recalled chat history, but memory blocks may still be included. UseContextBudget.MaxTokens/MaxCharactersfor a hard cap on total prompt size.
Changed
-
Every sample now calls a real Azure OpenAI chat and/or embedding model — no mocks. Removed
EchoChatClient/ShoppingEchoChatClient/StubEmbeddingGeneratorfrom every sample (AgentWithMemory, RealAgent, MemoryToolsAgent, ChatHistoryProvider, ShoppingAssistant, BlendedAgent, MinimalAgent, McpHost, and the AspireDemo app). A newsamples/AgentMemory.Samples.Sharedproject centralizes the wiring:RealAzureOpenAI.TryCreateresolvesAZURE_OPENAI_*environment variables and fails fast with setup instructions if they're missing (no silent mock fallback).MemoryTraceChatClientprints the<recalled_memory>context the provider injects before each live model call.SampleConsolegives each sample color-coded user/assistant/memory-action console output.
The five agent samples now let the model decide on its own when to call memory/product tools, rather than scripting the calls a mock model couldn't make itself.
Full Changelog: see CHANGELOG.md