Refactoring
Some checks failed
Build Linux App / build (push) Failing after 1m33s

This commit is contained in:
2026-02-23 10:02:23 -05:00
parent 21f1387fa8
commit 0c9eb8878d
57 changed files with 8179 additions and 1114 deletions

View File

@@ -0,0 +1,21 @@
/// Persistence interface for the trainer's knowledge base.
///
/// The implementation splits raw text into chunks, generates embeddings
/// via the Nomic server, stores them in the local database, and provides
/// semantic search for RAG context injection.
abstract class NoteRepository {
/// Splits [text] into overlapping chunks, generates an embedding for each,
/// and persists them under a shared [sourceId].
Future<void> addNote(String text);
/// Returns the [topK] most semantically similar chunk texts for [query].
/// Returns an empty list if no chunks are stored or the embedding server
/// is unavailable.
Future<List<String>> searchSimilar(String query, {int topK = 3});
/// Returns the total number of stored chunks.
Future<int> getChunkCount();
/// Deletes every stored chunk (full knowledge-base reset).
Future<void> clearAll();
}