Files
agentik/storage-inmemory
subochev bd65c29b48
ci / JVM build + tests (push) Successful in 6m14s
refactor(message-log-api): split MessageStore into read-only and mutable interfaces
- Introduced `MutableMessageStore` for producers with an `append` operation, separate from read-only `MessageStore`.
- Updated all consumers and implementations to use the appropriate interface (`read-only` for observers, `mutable` for producers).
- Improves modularity and ensures compile-time guarantees against unintended write operations in the audit log.
2026-09-20 21:08:55 +03:00
..

:storage-inmemory — in-memory реализация :storage-core (KMP, jvm + native)

Что это

In-memory реализация MessageStore / WorkingMemoryStore / ConversationStore / ReflectionStore. Все структуры держит в ConcurrentHashMap + MutableList, фолотится на RAM (никаких файлов).

Решает: дешёвая тестовая среда без поднятия SQLite. Позволяет прогонять ChatAgentTest за миллисекунды и держать сценарии детерминированными.

Где используется

  • В тестах :standalone (AbstractITTest).
  • В Android-имплементации (in-memory + Android-database микс).
  • В любых юнит-тестах на агенте.

Как подключить

commonMain.dependencies {
    api("pw.binom.agentik:storage-inmemory:0.1.0")
    api("pw.binom.agentik:storage-core:0.1.0")
}

val storage = InMemoryStorageSystem()
val messages: MessageStore = storage.messages
val working: WorkingMemoryStore = storage.working

Версии

gradle/libs.versions.toml → [versions] agentik-storage-inmemory.

Тесты

./gradlew :storage-inmemory:allTests

Покрывают (через общие contract-tests): round-trip, paged flow, concurrent appends, working-memory replay, очистку.

Чего здесь НЕТ

  • Никакого persistence. Перезапуск процесса — данные пропали. Это нормально для тестов и Android in-memory.

Текущий статус

Используется продакшеном (в режиме тестов). Контракт-совместима с :storage-sqlite 1:1 — переключение AGENTIK_STORAGE_BACKEND=memory в :standalone.