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;sourcesas a JSON-encoded array;embeddingas a float32 BLOB or NULL.Indexes on
subjectand(subject, predicate)for the common filter shapes.
Classes¶
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 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 itsvalid_untilto the new fact’svalid_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¶