Skip to content

JsonStore

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/memory/json-store.ts

Implements: MemoryStore

Methods

MethodSignatureReturns
savesave(record: MemoryRecord)void
loadload(id: string)`MemoryRecord
queryquery(query: MemoryQuery)MemoryRecord[]
deletedelete(id: string)boolean
getAllgetAll(projectId: string)MemoryRecord[]
countcount(projectId: string)number
touchtouch(id: string)void

Where it refuses work

  • JsonStore stops the work with an early return when found, in 2 places.
  • JsonStore stops the work with an early return when a.confidence !== b.confidence.
  • JsonStore stops the work with an early return when a.accessCount !== b.accessCount.
  • JsonStore stops the work with an early return when !record.
  • JsonStore stops the work with an early return when this.cache.has(projectId).

When something fails

  • JsonStore handles failure in 7 places: it discards it silently in 4, turns it into a return value in 2, and logs it and continues in 1.

Was this page helpful?

Download as PDF