flutter_agent_memory library

Dart memory library for building a question/answer/note knowledge base powered by LLMs.

Classes

AnalysisResult
Raw extraction result returned by the analysis agent.
Answer
A knowledge-base answer.
CliCommand
Metadata for a CLI command or subcommand.
ConsolidationResult
A structured result produced by the consolidation agent.
ContributionItem
FileKbStorage
File-system implementation of KbStorage.
Frontmatter
Simple YAML-like frontmatter parser/serializer.
HttpKbStorage
HTTP-backed implementation of KbStorage.
InMemoryKbStorage
In-memory implementation of KbStorage.
InputContent
A single piece of input content loaded from disk or stdin.
InputLoader
Loads input content for the analysis pipeline.
KBAggregationAgent
Generates narrative descriptions for people, topics, and areas.
KBAnalysisAgent
Extracts structured knowledge (questions, answers, notes) from raw text and optionally images.
KBAnalysisValidator
Removes incomplete entities from an analysis result.
KBConsolidationAgent
Consolidates a set of memory records into a high-level summary and reusable skill cards, similar to the global consolidation phase in advanced memory systems.
KBContext
Existing knowledge-base state used for incremental updates.
KBContextLoader
Loads existing knowledge-base state from disk.
KBFileParser
Parses knowledge-base entities from Markdown files.
KBGraphBuilder
KBIdMapper
Maps temporary AI IDs (q_1, a_1, n_1) to permanent IDs (q_0001, ...).
KbMarkdownRenderer
Renders knowledge-base entities as Obsidian-compatible Markdown strings.
KBMemoryStore
Agent memory store backed by a pluggable KbStorage backend.
KBOrchestrator
Main coordinator for building and updating the knowledge base.
KBOrchestratorParams
Parameters for the knowledge-base orchestrator.
KBQAMappingService
Applies AI Q&A mapping to an analysis result.
KBQuestionAnswerMappingAgent
Maps new answers and notes to existing unanswered questions.
KBRerankerAgent
Reranks a small set of candidate memory records for a given query using an LLM. This is useful when lexical/tag-based scoring is not enough to surface the most relevant record.
KBResult
Result of a knowledge-base build operation.
KBSearchEngine
Searches the knowledge base by tags, text, or entity type.
KBSearchResult
Result of a knowledge-base search.
KBSecretRedactionAgent
Redacts common secret patterns from text before it is stored in the knowledge base.
KBStatistics
Generates index and overview files for the knowledge base.
KbStorage
Abstract storage backend for the agent knowledge base.
KBStructureBuilder
Writes the Obsidian-compatible Markdown knowledge-base structure.
KBStructureManager
High-level coordinator that writes the whole Markdown structure.
KBTagGeneratorAgent
Generates a concise set of search tags from a natural-language query.
KBTextSearchResult
Result of a natural-language search that uses an LLM to generate tags.
A URL reference embedded in a question, answer, or note.
LlmConfig
Configuration values for LLM providers.
LlmMessage
A single message in a conversational LLM exchange.
LlmProvider
Abstract interface for any LLM provider.
Mapping
MemoryConsolidationWriter
Writes the result of a consolidation run: the MEMORY.md summary and the derived skill cards.
MemoryDedupService
Encapsulates capture-time duplicate detection for questions, answers and notes.
MemoryLevelService
Promotes or expires notes according to a MemoryPromotionPolicy.
MemoryPromotionPolicy
Policy controlling automatic promotion and expiry of memory levels.
MemoryProvenanceService
Creates cross-scope note copies with a provenance marker.
MemoryRecord
A unified view of a knowledge-base record used by the memory store.
MemoryRevision
A content snapshot plus its SHA-256 revision hash.
MemoryRevisionService
Manages optimistic concurrency for the top-level MEMORY.md summary file.
Note
A standalone knowledge-base note.
OpenAiProvider
OpenAI-compatible chat provider.
OpenRouterProvider
OpenRouter provider.
PersonContributions
Aggregated contributions for a single person.
ProviderFactory
Factory for creating the default LlmProvider based on LlmConfig.
QAMappingResult
Result of mapping new answers/notes to existing questions.
Question
A knowledge-base question.
QuestionSummary
SkillCard
A single reusable skill extracted from memory.
SourceConfig
Per-source sync metadata stored in inbox/source_config.json.
SourceConfigManager
Loads and persists per-source sync metadata.
SourceInfo
TopicContribution
WebKbStorage
Browser-storage implementation of KbStorage.

Enums

InputType
Supported input type for the analysis pipeline.
KBProcessingMode

Mixins

KbStorageContextMixin
Shared context-scanning logic for KbStorage adapters.

Properties

agentMemoryCommands List<CliCommand>
Top-level commands exposed by the agent_memory CLI.
final

Functions

buildRootParser() → ArgParser
Builds the root ArgParser from the command registry.
buildSkillHelp({String format = 'markdown'}) String
Builds a structured skill/cheat-sheet for LLM agents.
currentUtcTimestamp() String
extractBody(String content) String
memoryFingerprint(Note note) String
Builds a stable fingerprint for a note based on content and level.
normalizeMemoryText(String text) String
Normalizes a memory text for duplicate detection.
normalizePersonName(String name) String
Normalizes a person name for wikilinks (spaces → underscores, preserves case).
parseFrontmatter(String content) Frontmatter
Parses the first YAML frontmatter block of a Markdown document.
personFileId(String name) String
Normalizes a person name for filesystem paths (lowercase, spaces → underscores).
printAgentMemoryUsage({ArgParser? parser, List<CliCommand>? commands, StringSink? sink}) → void
Prints unified help to the given sink.
revisionHash(String content) String
Computes a SHA-256 hash of content and returns it as a hex string.
slugify(String text) String
Creates a slug from arbitrary text (lowercase, hyphen-separated).

Exceptions / Errors

ConcurrentRevisionException
Exception thrown when an optimistic concurrency check fails.