Class FileKnowledgeStore

java.lang.Object
com.tnsai.session.extraction.FileKnowledgeStore
All Implemented Interfaces:
KnowledgeStore

public class FileKnowledgeStore extends Object implements KnowledgeStore
File-based implementation of KnowledgeStore.

Stores knowledge as JSON files organized by type:

 basePath/
 ├── solution/
 │   ├── knowledge-abc123.json
 │   └── knowledge-def456.json
 ├── pattern/
 │   └── knowledge-ghi789.json
 └── index.json
 

Durability: knowledge files and the index are written atomically (temp file + atomic move), and the index is only persisted when an entry actually changes, not on every save. Index writes are synchronized within the JVM, but the store assumes a single-writer contract per directory (each instance keeps its own in-memory index cache).

Author:
TnsAI Team