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)
| System | Examples |
|---|---|
| Storage | SqliteStorageProvider (IStorageProvider) |
| Notes | NoteService (INoteService) |
| Knowledge / RAG | KnowledgeService (IKnowledgeService), SqliteVectorStore (IVectorStore) |
| AI | AIOrchestrator (IAIOrchestrator), SkillRegistry, model/registry helpers |
| Updates | VelopackUpdateService (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
- Implement the Core interface (or add a new interface in Core first).
- Register in
Bootstrapperwith appropriate lifetime (Singletonfor heavy/shared services). - 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;Apptears 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