jeevesagent.memory.sqlite_facts
===============================

.. py:module:: jeevesagent.memory.sqlite_facts

.. autoapi-nested-parse::

   SQLite-backed bi-temporal fact store.

   Same shape as :class:`InMemoryFactStore` (supersession on append,
   ``valid_at`` queries, optional embedder) but durable across process
   restarts. Sync sqlite3 calls dispatched through
   :func:`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
-------

.. autoapisummary::

   jeevesagent.memory.sqlite_facts.SqliteFactStore


Module Contents
---------------

.. py:class:: SqliteFactStore(path: str | pathlib.Path, *, embedder: jeevesagent.core.protocols.Embedder | None = None)

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


   .. py:method:: aclose() -> None
      :async:



   .. py:method:: all_facts() -> list[jeevesagent.core.types.Fact]
      :async:



   .. py:method:: append(fact: jeevesagent.core.types.Fact) -> str
      :async:


      Append a fact, invalidating any superseded predecessors.

      Same supersession rule as :class:`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``.



   .. py:method:: 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]
      :async:



   .. py:method:: recall_text(query: str, *, limit: int = 5, valid_at: datetime.datetime | None = None, user_id: str | None = None) -> list[jeevesagent.core.types.Fact]
      :async:



   .. py:property:: embedder
      :type: jeevesagent.core.protocols.Embedder | None



   .. py:property:: path
      :type: pathlib.Path



