Nao.Persistence Namespace
| Type/Module | Description |
|
Low-level, provider-agnostic ADO.NET helpers built on System.Data.Common. All SQL uses '@name' parameters (supported by SQLite, SQL Server, PostgreSQL and MySQL providers) and portable DDL (CREATE TABLE IF NOT EXISTS). |
|
|
ADO.NET-backed IAuditLog. The AuditAction/PermissionLevel unions are encoded to text columns so the schema stays portable across providers. |
|
|
ADO.NET-backed IExecutionJournal. History is returned most-recent-first. |
|
|
Feedback persisted in the nao_feedback_entries table (keyed by feedback Id). |
|
|
ADO.NET-backed IMemoryStore. Provider-agnostic: works with any database reachable through an IDbConnectionFactory. |
|
|
ADO.NET-backed ISemanticMemory. Embeddings are stored as JSON; similarity is computed in-process so the implementation stays provider-agnostic. |
|
|
Turns persisted in the nao_feedback_turns table (keyed by TurnId). |
|
|
Codec for the AuditAction discriminated union (encoded as a small JSON DTO). |
|
|
Factory helpers for audit log implementations. |
|
|
Helpers for building connection factories. |
|
|
ADO.NET event store: a single portable table holding ordered JSON events, partitioned by a logical stream name. Provider-agnostic via IDbConnectionFactory. |
|
|
CLIMutable DTOs for file persistence and conversion helpers shared by both backends. |
|
|
Mutating events for episodic memory persistence. |
|
|
Factory helpers for episodic memory persistence. |
|
|
Factory helpers for event stores. |
|
|
Factory helpers for execution journal implementations. |
|
Backend factories for |
|
|
Persists feedback that flows over the event bus and serves the read/command side for a session. It is BOTH an event consumer (the write side — it persists TurnCompleted under each session's folder) AND the provider of the read/command FeedbackService for a session (the query side). The folder is derived from the event's session key by `rootFor`; the backing FeedbackService is the store-level swap point (File today, Database later), so changing where data lands needs no producer change. |
|
|
FileSystem-backed IAuditLog. A single append-style JSON document. |
|
|
FileSystem event store: newline-delimited JSON, one event per line. |
|
|
FileSystem-backed IExecutionJournal. A single JSON document, newest-first. |
|
|
Feedback persisted as JSONL at |
|
|
Simple file-backed JSON document helpers (whole-file read/write). |
|
|
FileSystem-backed IMemoryStore. One JSON document per agent under {baseDir}. |
|
|
FileSystem-backed ISemanticMemory. One JSON document per agent. |
|
|
Turn records persisted as JSONL at |
|
|
Shared System.Text.Json options with full F# support (discriminated unions, options, lists, maps, single-case unions). Used by the event-sourced stores so the rich domain types serialize without bespoke DTOs. |
|
|
Mutating events for knowledge-graph persistence. |
|
|
Factory helpers for graph memory persistence. |
|
|
Provider-agnostic factory that creates ADO.NET connections. The persistence layer never references a concrete database provider — callers supply a factory backed by any provider (Microsoft.Data.Sqlite, Npgsql, Microsoft.Data.SqlClient, MySqlConnector, ...). This keeps a single unified implementation that works against any ADO.NET-compatible database. |
|
|
Append-only event log used for event-sourced persistence of the richer stores. The store records each mutating call as a serialized event and replays them in order to rebuild in-memory state, reusing the existing in-memory query logic. |
|
|
Consolidated constructors for the in-memory reference implementations that used to live in Nao.Agents. Nao.Agents now exposes only interfaces/types; hosts and tests pick a concrete store from here (or one of the ADO/file factories) without the agent layer depending on any storage technology. |
|
|
In-memory audit log for testing (moved out of Nao.Agents) |
|
|
In-memory episodic memory implementation |
|
|
In-process synchronous bus: publishing awaits every consumer so persistence is deterministic for the desktop app. A failing consumer is isolated (its exception is swallowed) so one bad sink never breaks a producer's turn. |
|
|
In-memory execution journal (default implementation) |
|
|
In-memory knowledge graph implementation |
|
|
In-memory metrics collector |
|
|
In-memory semantic memory implementation |
|
|
In-memory implementation of IMemoryStore for testing and simple scenarios |
|
|
In-memory implementation of ITieredMemory with promotion, demotion, and eviction |
|
|
In-memory implementation of tool discovery with usage-based ranking |
|
|
In-memory tracer for testing and local development |
|
|
In-memory trace store for testing |
|
|
In-memory implementation of working memory |
|
|
JSON helpers used for serializing collection/value types into TEXT columns and to standalone files. Uses System.Text.Json with CLIMutable DTOs so the same payloads round-trip through both backends. |
|
|
Factory helpers for memory store implementations. |
|
|
Factory helpers for metrics collector persistence. |
|
|
Mutating events for metrics persistence. |
|
|
Codec for the PermissionLevel discriminated union. |
|
|
Builds concrete persistence components for a chosen `PersistenceMode`. The rest of the system depends only on the interfaces; this module is the one place that maps a mode to an implementation, so swapping file for database is a single edit. |
|
|
Selects which durable backend the persistence factories should produce. The host turns this single knob to choose between the two storage categories: file system or database. |
|
|
Event-sourced IEpisodicMemory. Delegates all query logic to an in-memory instance rebuilt by replaying the event log, so similarity/graph behaviour is identical to InMemoryEpisodicMemory. |
|
|
Event-sourced IGraphMemory. Query/traversal logic is delegated to an in-memory instance rebuilt by replaying the event log. Relations produced by ExtractRelationsAsync are persisted as concrete AddRelation events so reloads never re-run a (possibly external) extractor. |
|
|
Event-sourced IMetricsCollector. |
|
|
Event-sourced ITieredMemory. Note: time-relative eviction is re-evaluated at load time when an Evict event replays, which is the desired durability behaviour. |
|
|
Event-sourced tool discovery. Wraps InMemoryToolDiscovery, persisting recorded invocations so usage-based ranking survives restarts. Tool registration is a passthrough (re-register tools at startup as part of application wiring). |
|
|
Event-sourced ITracer. Span identifiers are generated internally, so this is a self-contained implementation (mirroring InMemoryTracer) that persists each span upsert as a full span snapshot and rebuilds the span table on load. |
|
|
Event-sourced ITraceStore. |
|
|
Event-sourced IWorkingMemory. |
|
|
Filesystem-safe identifier sanitization. |
|
|
Factory helpers for semantic memory implementations. |
|
|
A simple bag-of-words embedding provider for testing (no external dependencies) |
|
|
Mutating events for tiered memory persistence. |
|
|
Factory helpers for tiered memory persistence. |
|
|
ISO-8601 round-trippable timestamp helpers (stored as TEXT for portability). |
|
|
Factory helpers for tool discovery persistence. |
|
|
Mutating events for tool-discovery persistence. Only usage statistics are durable; the in-process tool registry (populated via Register) is runtime configuration and is not persisted. |
|
|
Factory helpers for tracer persistence. |
|
|
Mutating events for trace-store persistence. |
|
|
Factory helpers for trace store persistence. |
|
|
Factory helpers for working memory persistence. |
|
|
Mutating events for working memory persistence. (Attention boosts from GetAsync are read-side effects and are not persisted.) |
Nao