Engine Application

Data Access

The persisted domain model itself lives in the common library; the engine adds the repositories that read and write it, plus a number of engine-local documents.

Repository interfaces are in engine/repository/ and are discovered by the @Enable*Repositories declarations of EngineConfiguration over ai.promethist.**.repository.

MongoDB Repositories

All of these are reactive Spring Data repositories (ReactiveMongoRepository) unless noted.

Repository Documents

TenantRepository, ProjectRepository

Tenants and projects.

AgentRepository

Agents and their revisions, with lookups by ref, key and state — the queries behind revision and publish-state resolution.

TemplateRepository

Agent templates, by ref and state.

SkillRepository

Agent skills, by ref.

SessionRepository

Sessions. Extends CustomSessionRepository, whose implementation (CustomSessionRepositoryImpl, on ReactiveMongoTemplate) adds the operations Spring Data cannot derive — notably atomically claiming one disconnected session and marking it abandoned, which is how the engine reclaims sessions whose client vanished.

TurnRepository

Turns, including the session-listing queries used by the session history endpoints.

UserRepository

Users.

DeviceRepository

Devices, resolved by ref on every connection.

StarredAgentRepository, RecentAgentsRepository, FeaturedAgentRepository

The per-user and per-project agent groupings returned with a project.

MemoryStateRepository

Memory snapshots created and restored through the memory endpoints.

MemoryRepository, ReactiveMemoryRepository

Memory units by ID prefix. MemoryRepository is the blocking variant, used where a synchronous read is unavoidable.

RealtimeConfigurationRepository

Stored realtime (speech-to-speech) configurations.

SecretRepository

Secrets, scoped by tenant, project and type.

OAuthTokenRepository, OAuthStateRepository

Stored third-party OAuth tokens and the short-lived state of an in-flight authorization flow.

BasicIdentityRepository

Basic authentication identities, looked up by username and secret.

LLMLogRepository

Language model invocation logs, by session.

EDRRepository

Event detail records used for usage metering.

NavigationStateRepository

Per-user navigation entry state, by user and project, and of one entry across the users of a project (for the manual refresh). Also performs the guarded upserts: an unconditional state write for the session-end judge, and a write for evaluations and the catch-up on earlier evaluations guarded by the state it moves the entry from (changeStateIf).

ProfanityValidationLogRepository

Results of profanity validation.

Elasticsearch

Memory and search go through the generic ElasticsearchRepository and its custom implementation in the common library: the scoped memory units with their embedding vectors, vector similarity search, and the indexes for technical and bug reports. MemoryConfiguration wires the scoped memories (session, short-term, knowledge) on top of it.

Engine-Local Documents and Types

engine/model/ holds the documents and value types that only the engine needs, as opposed to the shared model in common:

Type Purpose

BasicIdentity

A username/secret identity with an optional identity provider ref, for Basic authentication.

BasicPlan, RelationalPlan

The conversational plan produced by the planning managers.

SessionTopics, UserFacts, UserProfileEnhancement, ExtractedInfoService

Aggregated extraction results as they are stored and read back.

StarredAgent, RecentAgents, FeaturedAgent

The agent grouping records behind AgentGrouping.

EDR

An event detail record — active user and active duration for usage metering.

NavigationState

The state — HIDDEN, LOCKED or UNLOCKED — of one navigation entry for one user, written by an evaluation or by the session-end navigation judge. Absent until one of them changes it, in which case the entry’s configured default applies. isEnabled is still written alongside, as state == UNLOCKED, for engines that predate state; records from before it carry only isEnabled: true, read as UNLOCKED.

ProfanityValidationLog, ProfanityValidationStatus

Profanity validation outcomes.

OAuthState

The state and PKCE verifier of an in-flight OAuth flow.

TextTemplate

A named, renderable text template.

ToolCallHints

Hints attached to tool calls for the model.

HealthCheckResult

Result of a provider health probe.