save
Persists a fact to the local storage system with thread-safe guarantees. This method provides atomic updates to the fact collection by:
Creating necessary storage directories if they don't exist
Loading existing facts for the concept
Appending the new fact to the existing collection
Saving the updated collection atomically
Example usage:
// Save project dependency information
save(
fact = SingleFact(
concept = Concept("dependencies", "Project build dependencies", FactType.MULTIPLE),
timestamp = timeProvider.getCurrentTimestamp(),
value = "org.jetbrains.kotlin:kotlin-stdlib:1.8.0"
),
subject = MemorySubject.Project,
scope = MemoryScope.Product("my-app")
)
Content copied to clipboard
Parameters
fact
New fact to be stored
subject
Context category for the fact (e.g., MACHINE, PROJECT)
scope
Visibility scope for the fact (e.g., Agent, Feature)