Expand description
Core engine surface for power users and adapter authors.
Contains the EngineHandle, configuration, port traits, NoOp stubs, and use-case
request/response DTOs. Most consumers only need the ergonomic tier at the crate root.
§Example
use mempill::engine::{EngineConfig, NoOpOracle, NoOpVector};Structs§
- Audit
Query Request - Request to query the audit ledger.
- Audit
Query Response - Response from an audit ledger query.
- Audit
UseCase - Use-case: retrieve ordered audit ledger entries for an agent (or specific claim).
- Engine
Config - Configuration for the mempill engine.
- Engine
Handle - The sole public async entry point for mempill.
- Ingest
Claim Request - Public write request. Maps to domain Claim at the application boundary.
- Ingest
Claim Response - Response from a successful claim ingest.
- Ingest
Claim UseCase - Use-case: ingest a new claim from any binding.
Generic over persistence and oracle ports; zero-cost dispatch; testable with mocks.
Oracle is optional: when None, the oracle-absent branch fires for heavy-path contradiction resolution.
The pending store is type-erased via
ErasedPendingStoreto keep the use-case free of a third type parameter while still being injectable in tests. - NoOp
Oracle - A no-op oracle that accepts adjudication requests and immediately returns a unit handle.
- NoOp
Vector - A no-op vector store that discards all embeddings and returns empty search results.
- Pending
Adjudication Row - A row in the
pending_adjudicationstable. - Query
History Request - Request to retrieve the full history timeline for a (subject, predicate) subject-line.
- Query
History Response - Response from
query_history— the full ordered timeline for a subject-line. - Query
History UseCase - Use-case: retrieve the full ordered history timeline for a (subject, predicate) line.
- Query
Memory Request - Request to retrieve the current belief for a (subject, predicate) subject-line.
- Query
Memory Response - Response from a memory query — the canonical belief projection.
- Query
Memory UseCase - Use-case: query the canonical belief for a (subject, predicate) line. Generic over persistence and vector ports. Vector is optional: None = structural-only mode (v0.1 default).
- Reconcile
Request - Request to reconcile one or more subject lines.
- Reconcile
Response - Response from a reconciliation pass.
- Reconcile
UseCase - Use-case: run a reconciliation pass over the given subject-lines.
Enums§
- MemError
- Top-level error type for the mempill engine. Every invariant violation surfaces as a typed variant here — never silently swallowed.
Traits§
- Embedding
Port - Bring-your-own-embedding port for fuzzy candidate coverage (secondary tier). The engine is fully functional in structural-only mode when this port is absent.
- Extractor
Port - Stochastic extractor port. Host-implemented.
- Oracle
Port - The oracle port — pull-based, non-blocking.
- Pending
Adjudication Port - The pending-adjudication persistence port — read + write on the
pending_adjudicationstable. - Persistence
Port - The persistence port — INSERT-only, agent_id-first.
All methods take
agent_idas the primary parameter (not a filter). Must enforce: single-writer per agent_id; append-only; atomic commit unit. - Vector
Port - Vector persistence seam — kept separate from
PersistencePortfor model-swap safety.
Type Aliases§
- Belief
Result - Belief projection result — returned from query_memory.
- Write
Result - Write surface result — returned synchronously. For heavy-path ops, disposition = QueuedForAdjudication; final state arrives asynchronously via the oracle callback.