Skip to main content

Infrastructure layer

Purpose

Mnemo.Infrastructure implements durable storage, AI/RAG, statistics, import/export, speech, spellcheck, updates, and other long-running or IO-heavy services behind Core interfaces.

Code location

  • Mnemo.Infrastructure/ — mirror feature folders (Services/Notes, Services/AI, Services/Flashcards, …).

Main interfaces / classes (representative)

SystemExamples
StorageSqliteStorageProvider (IStorageProvider)
NotesNoteService (INoteService)
Knowledge / RAGKnowledgeService (IKnowledgeService), SqliteVectorStore (IVectorStore)
AIAIOrchestrator (IAIOrchestrator), SkillRegistry, model/registry helpers
UpdatesVelopackUpdateService (IUpdateService)

Use IDE search on Mnemo.Infrastructure + interface name from Core for the canonical implementation.

Startup / registration

All concrete singletons are wired in Bootstrapper.Build() before modules run (Mnemo.UI/Services/Bootstrapper.cs).

How to extend

  1. Implement the Core interface (or add a new interface in Core first).
  2. Register in Bootstrapper with appropriate lifetime (Singleton for heavy/shared services).
  3. Expose module-specific behavior via IModule.RegisterTools / HTTP APIs only if product needs—avoid circular lazy grabs between services.

Gotchas

  • Disposal: some services implement IDisposable; App tears down selected singletons on exit—follow existing patterns when adding native resources.
  • Async SQLite: respect cancellation and avoid blocking UI thread from Infrastructure APIs called by ViewModels.

Related: Data storage, AI and RAG pipeline