![]() |
VOOZH | about |
dotnet add package Ananke.Learning --version 0.8.5
NuGet\Install-Package Ananke.Learning -Version 0.8.5
<PackageReference Include="Ananke.Learning" Version="0.8.5" />
<PackageVersion Include="Ananke.Learning" Version="0.8.5" />Directory.Packages.props
<PackageReference Include="Ananke.Learning" />Project file
paket add Ananke.Learning --version 0.8.5
#r "nuget: Ananke.Learning, 0.8.5"
#:package Ananke.Learning@0.8.5
#addin nuget:?package=Ananke.Learning&version=0.8.5Install as a Cake Addin
#tool nuget:?package=Ananke.Learning&version=0.8.5Install as a Cake Tool
Empirical memory and experience-based learning for .NET AI agents — commit observations, recall patterns and heuristics, reinforce or contradict beliefs, run offline learning cycles, track episodes, and package learned behavior for transfer.
Part of the Ananke framework.
dotnet add package Ananke.Learning
This package depends on Ananke.Orchestration and Ananke.Abstractions.
Observation ----> CommitAsync ----> EmpiricalEntry (stored in IEmpiricalMemory)
|
Query -----------> RecallAsync ----------| vector similarity + tag overlap
|
Outcome ---------> ReinforceAsync -------| prediction-error -> confidence/strength
|
Background ------> LearnAsync -----------+ decay, curiosity, simulation, consolidation
An empirical entry represents a learned pattern, skill, or heuristic. Entries carry structured semantic descriptions, tags, confidence, observation history, affective signals, optional episode linkage, and optional entity scope. They are committed during agent execution, recalled by similarity, reinforced or contradicted by outcomes, and periodically swept by the offline learner.
| Type | Description |
|---|---|
IEmpiricalMemory |
Mutable store for empirical entries — commit, recall, reinforce, contradict, browse, count, mark consolidated, and pair-recall |
IEpisodeStore |
Persistence contract for completed action trajectories and outcomes |
IOfflineLearner |
Background learning sweep — decay, curiosity-driven exploration, and consolidation of mature entries |
ISimulationSource |
Domain-specific simulator that tests hypotheses and returns reward outcomes |
IPredictionSource |
Predicts expected confidence for an entry, enabling prediction-error reinforcement |
IConsolidationSummarizer |
Generates a summary when an entry is promoted from empirical memory to long-term knowledge |
IEntityMemoryProvider |
Creates entity-scoped memory facades over shared underlying stores |
IExplorationStrategy |
Exploration/exploitation strategy for choosing among predicted actions |
ITagImportanceTracker |
Tracks predictive importance of tags/features across outcomes |
ISkillPackager |
Exports/imports skill packages built from empirical entries and episodes |
| Type | Description |
|---|---|
InMemoryEmpiricalMemory |
Thread-safe in-memory IEmpiricalMemory with cosine-similarity recall and tag-overlap scoring |
OfflineLearner |
Default offline learning pipeline — decay, exploration, simulation, and consolidation |
InMemoryEpisodeStore |
In-memory persistence for completed episodes |
TagOverlapPredictionSource |
Predicts confidence from the average confidence of entries sharing the most tags |
MonteCarloRewardPropagator |
Propagates terminal rewards backward through episode steps |
TagImportanceTracker |
Default feature/tag importance tracker |
EntityMemoryProvider |
Lazily creates entity-scoped memory facades |
SkillPackager |
Default skill export/import implementation |
JsonSkillPackageFormat |
JSON-based skill package format |
| Type | Description |
|---|---|
EmpiricalEntry |
Learned pattern/skill/heuristic with semantic description, tags, confidence, evidence, affective signals, and optional episode/entity linkage |
EmpiricalKind |
Taxonomy — Pattern, Skill, Heuristic |
SemanticDescription |
Structured semantic summary and weighted tags used for embedding and tag overlap |
EmpiricalMatch |
Recall result with the matched entry and composite score |
Reinforcement |
Signal applied to an entry — evidence, reward, source, and adjustments |
RecallOptions, BrowseOptions, PairRecallOptions |
Recall and browse configuration |
AffectOptions |
Configures prediction-error and affect-driven learning behavior |
Episode, EpisodeStep, EpisodeOutcome |
Episode trajectory model used for credit assignment and skill packaging |
OfflineLearnerOptions, OfflineLearningResult |
Offline sweep configuration and outcome summary |
SkillExportOptions, SkillImportOptions, SkillExportResult, SkillImportResult |
Skill package transfer configuration and results |
| Type | Description |
|---|---|
EmpiricalMemoryTools |
ToolKit factory — registers recall_empirical, commit_insight, and reinforce_empirical as agent-callable tools |
using Ananke.Learning.EmpiricalMemory;
using Ananke.Orchestration.Knowledge.Embeddings;
var embedder = new InMemoryEmbedder();
var memory = new InMemoryEmpiricalMemory(embedder);
// Commit an observation
var entry = await memory.CommitAsync(new EmpiricalEntry
{
Id = Guid.NewGuid().ToString("N"),
Kind = EmpiricalKind.Pattern,
Tags = ["strategy", "center-control"],
Source = "manual-observation",
Description = new SemanticDescription
{
Summary = "Placing pieces in the center column creates more threats",
SemanticTags = new Dictionary<string, float>
{
["strategy:center-control"] = 1.0f,
["domain:connect4"] = 0.8f
}
},
Confidence = 0.5f,
ObservationCount = 1,
Evidence = [],
FirstObserved = DateTimeOffset.UtcNow,
LastObserved = DateTimeOffset.UtcNow
});
// Recall by similarity
var matches = await memory.RecallAsync(
"what strategy works for opening moves?",
new RecallOptions { TopK = 5 });
await memory.ReinforceAsync(entry.Id, new Reinforcement
{
Reward = 1.0f,
NewEvidence = ["won the game after using this strategy"],
Source = "game-outcome"
});
using Ananke.Abstractions.Agents;
using Ananke.Learning.Offline;
using Ananke.Orchestration.Knowledge;
var knowledgeStore = new InMemoryKnowledgeStore(embedder);
var learner = new OfflineLearner(
memory,
embedder,
knowledgeStore: knowledgeStore,
options: new OfflineLearnerOptions
{
ExplorationBatchSize = 5,
ConsolidationMinObservations = 10,
ConsolidationMinStrength = 0.8f,
});
var result = await learner.LearnAsync();
// result.Decayed, result.Explored, result.Consolidated
using Ananke.Learning.EntityMemory;
var provider = new EntityMemoryProvider(
conversationMemory,
memory,
episodeStore,
knowledgeStore);
var customerMemory = provider.GetOrCreate("customer-123");
var customerPatterns = await customerMemory.Empirical.RecallAsync("billing dispute");
using Ananke.Learning.Skills;
var packager = new SkillPackager();
await using var writer = new JsonSkillPackageFormat().CreateWriter(stream);
var export = await packager.ExportAsync(
new SkillExportOptions { Name = "support-playbook", Domain = "customer-support" },
memory,
writer,
episodes: episodeStore);
var toolkit = EmpiricalMemoryTools.Create(memory);
// Register toolkit.Tools with an AgentJob so the LLM can
// recall patterns, commit new observations, and reinforce entries
// through natural-language tool calls.
EmpiricalEntry with semantic tags and an embedding.ISimulationSource.IKnowledgeStore for long-term retention.Ananke.Learning owns empirical memory, episodes, offline learning, feature tracking, entity-scoped facades, and skill packaging.Ananke.Orchestration.Knowledge supplies the long-term knowledge store used during consolidation.Ananke.Orchestration supplies ToolKit integration for exposing learning capabilities to agents.| Package | What it adds |
|---|---|
Ananke.Orchestration |
Workflow engine, tool integration, and access to the knowledge package |
Ananke.Orchestration.OpenAI |
OpenAI embedding model for production vector search |
Ananke.Qdrant |
Qdrant-backed IEmpiricalMemory and IKnowledgeStore for persistent storage |
See the Connect4 learning demo in the repository for an agent that learns strategy through self-play, empirical memory, and offline consolidation.
Full docs, demos, and architecture: github.com/sevensamurai/Ananke
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Ananke.Learning:
| Package | Downloads |
|---|---|
|
Ananke.Qdrant
Qdrant vector database provider for Ananke — IKnowledgeStore implementation with dense vector search, metadata filtering, and automatic collection management. |
|
|
Ananke.Organics
Organic mesh architecture for Ananke — self-organizing workflow ecosystems with cell division, heartbeat sensing, triage routing, domain-affine memory, and evolutionary division policies. |
This package is not used by any popular GitHub repositories.