027 — Runtime candidate profile overlay in tenant store¶
Status: ACCEPTED Date: 2026-06-13
Context¶
The matching pipeline already computes profile-aware relevance for JobRecord, but profile catalogs are currently static and file-backed. That does not support the operating mode we want:
- one Telegram user keeps multiple runtime profiles;
- the user can switch the active profile without editing files;
- search and digest should rerank against the active user profile immediately;
- the solution must stay store-agnostic and reuse the tenant-scoped runtime model already used for source overlays.
Decision¶
Persist candidate profiles as tenant-scoped runtime records in the tenant store.
- Candidate profiles are stored per
(user_id, profile_id)asManagedCandidateProfile. - Active profile is stored separately per
user_id. TenantRunnerexposes save/list/set-active/get-active operations.TenantRunner.search_jobs()andTenantRunner.latest_jobs()accept optionaluser_id/profile_idand rerank the already-fetchedJobGrouplist in memory using the existingMultiProfileMatchNode.- Adapter surfaces (Telegram bot, API bridge, MCP) write and read these runtime profiles; static file-backed catalogs remain the bootstrap/default profile path.
Consequences¶
- (+) Profile operations work across memory / SQLite / PostgreSQL because they only depend on
StoreConnector. - (+) User-facing relevance changes take effect immediately without rebuilding tenant config.
- (+) Existing matching logic is reused; no second scoring engine is introduced.
- (-) Runtime user profiles are not part of the static tenant config dump.
- (-) Initial bot profile capture is intentionally simple text-first input, not full resume file parsing.