jeevesagent.memory.sqlite_facts

SQLite-backed bi-temporal fact store.

Same shape as InMemoryFactStore (supersession on append, valid_at queries, optional embedder) but durable across process restarts. Sync sqlite3 calls dispatched through anyio.to_thread.run_sync().

Schema:

  • facts(id, subject, predicate, object, confidence, valid_from, valid_until, recorded_at, sources, embedding) — timestamps stored as unix-epoch floats; sources as a JSON-encoded array; embedding as a float32 BLOB or NULL.

  • Indexes on subject and (subject, predicate) for the common filter shapes.

Classes

SqliteFactStore

Durable bi-temporal fact store rooted at a sqlite file.

Module Contents

class jeevesagent.memory.sqlite_facts.SqliteFactStore(path: str | pathlib.Path, *, embedder: jeevesagent.core.protocols.Embedder | None = None)[source]

Durable bi-temporal fact store rooted at a sqlite file.

async aclose() None[source]
async all_facts() list[jeevesagent.core.types.Fact][source]
async append(fact: jeevesagent.core.types.Fact) str[source]

Append a fact, invalidating any superseded predecessors.

Same supersession rule as InMemoryFactStore: if there’s an existing currently-valid fact with matching subject + predicate but different object, set its valid_until to the new fact’s valid_from.

async query(*, subject: str | None = None, predicate: str | None = None, object_: str | None = None, valid_at: datetime.datetime | None = None, limit: int = 10, user_id: str | None = None) list[jeevesagent.core.types.Fact][source]
async recall_text(query: str, *, limit: int = 5, valid_at: datetime.datetime | None = None, user_id: str | None = None) list[jeevesagent.core.types.Fact][source]
property embedder: jeevesagent.core.protocols.Embedder | None
property path: pathlib.Path