In Memory Proposition Repository
In-memory implementation of PropositionRepository with optional vector similarity search. Thread-safe using ConcurrentHashMap, but not intended for production use.
The embedding service is optional. When one is supplied, embeddings are computed and cached for cosine similarity search and clustering. When it is absent (the default), the vector similarity and clustering paths degrade gracefully to empty results, while plain storage and lookups (save, findById, findAll, findByContextIdValue, etc.) keep working. This lets consumers that only need store-and-retrieve construct the repository without supplying an embedder.
Parameters
optional embedder; when null, vector paths return empty results.
Constructors
Properties
Which backend provides this repository. Implementations override to advertise their kind; used to select/flip between in-memory and persistent backends.
Whether this particular instance can really subtract. Implementing the interface is a type-level promise; this is the runtime truth for an implementor whose ability depends on configuration. A caller checks this before trusting the type.
Whether this particular instance can actually answer these queries. Implementing the interface is a type-level promise; this is the runtime truth. A decorator that forwards to a backend it only discovers at construction time reports here whether the backend it got can answer. Callers check this before trusting an empty result.
Vector search only works when an embedder was supplied; otherwise the type claims it but can't.
Functions
Appends evidence in one atomic step, so an entry added while a subtractProvenance is in flight survives it.
Delete all propositions in the given context.
Delete all propositions whose context id starts with the given prefix.
Remove all provenance from a proposition.
Find propositions that were abstracted from the given proposition. Searches for propositions that cite the given ID in their Proposition.sourceIds.
Get all propositions, optionally guaranteeing loaded provenance. With withProvenance = true every result has its Proposition.provenanceEntries populated (at extra read cost); the default delegates to the lean findAll — fine for backends that always carry provenance (e.g. in-memory).
Get all propositions.
Find all propositions ordered by effective confidence (highest first). Applies time-based decay to confidence scores.
Find propositions in the given context.
Java-friendly variant of findByContextId that accepts a plain string.
Find propositions created within a time range.
Find propositions from a time range, ordered by effective confidence as of a point in time. Useful for temporal analysis: "What was most confidently true during Q1?"
Find propositions with effective confidence above a threshold.
Find all propositions that mention a specific entity.
Find all propositions grounded by a specific chunk.
Find a proposition by its ID.
Find propositions at or above the specified abstraction level. Level 0 = raw observations, 1+ = abstractions.
Find propositions last touched within a time range. "Touched" means any update — content or administrative — so this anchors on Proposition.lastTouched (the later of contentRevised/metadataRevised), not the decay anchor alone.
Find propositions in contextId with evidence from any revision of sourceKey.
Find propositions in contextId with evidence from exactly ref's source key and revision.
Find all propositions with the given status.
Find clusters of similar propositions.
All pinned propositions in contextId.
Find propositions in contextId with revisionless evidence whose locator key equals locator's key.
Find propositions similar to the given text using vector similarity.
Find propositions similar to the given text with similarity scores.
Vector similarity search with an additional PropositionQuery filter applied to results.
Find the source propositions that a given proposition was abstracted from. Resolves the proposition's Proposition.sourceIds to actual propositions.
Pin a proposition so it resists reclamation: pinned propositions are skipped by the decay collector and the sweep policy, are decay-exempt in the default status policy, and are not auto-retired by contradiction resolution.
The provenance entries of a proposition, or an empty list if it has none or does not exist.
Resolves the diamond: both PropositionStore and VectorSearchCapable declare query. This explicitly routes to the base store's implementation; concrete stores can still override for backend-level filtering.
Query propositions, optionally guaranteeing loaded provenance. With withProvenance = true every result has its Proposition.provenanceEntries populated (at extra read cost); the default delegates to the lean query. See the provenance read contract on PropositionStore.findAll.
Re-embed every stored proposition with the currently-configured embedding service.
Save a proposition. If a proposition with the same ID exists, it will be replaced.
Save multiple propositions.
Save multiple propositions and report which stored proposition each one landed on.
Authoritatively set a proposition's provenance to exactly entries, removing any not listed.
Takes a whole collapse's fold off in one atomic step, honouring ProvenanceSubtractionCapable's contract.
Take exactly the evidence named by provenanceRefs off propositionId, leaving the rest of its evidence, grounding and source ids alone.
Refresh Proposition.lastAccessed to now for ids — the read-side reinforcement that lets a DECAYING proposition's decay anchor (see Proposition.effectiveConfidenceAt) track actual use rather than only content edits. Best-effort and silent about unknown ids (a stale eager id that has since been deleted is not an error).
Clear a proposition's pin, returning it to normal reclamation.