Property Memory
Memory
Gets or sets the memory system for persistent knowledge storage and retrieval.
public AgentMemory Memory { get; set; }
Property Value
Examples
Configuring agent memory:
using LMKit.Model;
using LMKit.Agents;
using var model = new LM("path/to/model.gguf");
using var embeddingModel = new LM("path/to/embedding-model.gguf");
var agent = new Agent(model);
// Configure memory
agent.Capabilities.Memory = new AgentMemory(embeddingModel);
// Add information to memory
await agent.Capabilities.Memory.AddAsync("User prefers detailed explanations.");
await agent.Capabilities.Memory.AddAsync("User is a software developer.");
Remarks
Memory enables the agent to retain and recall information across conversations. It uses semantic search to find relevant context based on the current query, allowing the agent to provide personalized and contextual responses.