jeevesagent.memory.chroma_facts

Chroma-backed bi-temporal fact store.

Each fact lives in a Chroma collection as a (id, embedding, document, metadata) tuple. The metadata carries the bi-temporal fields:

  • subject / predicate / object — strings

  • confidence — float

  • valid_from_ts / recorded_at_ts — unix-epoch floats

  • valid_until_ts — unix-epoch float; 0.0 when still valid

  • currently_valid — bool, mirrors valid_until_ts == 0 so we can use it directly in Chroma’s where filters

  • sources — JSON-encoded list of episode ids

Supersession is two round-trips: a coll.get to find the prior currently-valid facts with matching subject + predicate + different object, followed by a coll.update that flips their currently_valid to false and stamps valid_until_ts to the new fact’s valid_from.

Attributes

Classes

ChromaFactStore

Bi-temporal fact store backed by a Chroma collection.

Module Contents

class jeevesagent.memory.chroma_facts.ChromaFactStore(client: Any, *, embedder: jeevesagent.core.protocols.Embedder | None = None, collection_name: str = DEFAULT_FACTS_COLLECTION)[source]

Bi-temporal fact store backed by a Chroma collection.

async aclose() None[source]
async all_facts() list[jeevesagent.core.types.Fact][source]
async append(fact: jeevesagent.core.types.Fact) str[source]
classmethod ephemeral(*, embedder: jeevesagent.core.protocols.Embedder | None = None, collection_name: str = DEFAULT_FACTS_COLLECTION) ChromaFactStore[source]
classmethod local(persist_directory: str, *, embedder: jeevesagent.core.protocols.Embedder | None = None, collection_name: str = DEFAULT_FACTS_COLLECTION) ChromaFactStore[source]
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
jeevesagent.memory.chroma_facts.DEFAULT_FACTS_COLLECTION = 'jeeves_facts'