Training-search core¶
Current flow¶
training_finder_process supports both ordinary recommendations and learning
plans.
- Resolve the natural-language request against conversation, profile and preference context.
- Generate an embedding for the canonical enriched-title query.
- Build deterministic vector and full-text queries plus shared filters for the active MongoDB or PostgreSQL backend.
- Exclude previous suggestions, unavailable content, completed/disliked training and content outside the user's access groups.
- Execute vector and full-text queries concurrently.
- Merge their ranked lists in Python using weighted RRF.
- When the fused list is empty and the initial search had a language filter, retry the same hybrid search once without any language restriction.
- Keep the requested number of candidates in exact RRF order, generate collection metadata and assemble either suggestions or the learning plan. No post-retrieval reranking changes this order.
The vector side uses the enriched-title field/index populated during training standardization. Search also broadens canonical enriched-title terms so catalog wording differences do not suppress relevant content.
Semantic query expansion stays within the requested subject. For SQL courses, SQL joins or SQL schema definition (DDL) are suitable subtopics; generic database design is too broad unless explicitly requested. These examples do not impose a fixed query. The relevance of retrieved results remains a separate evaluation. For active listening, reflective listening, paraphrasing what was heard or asking clarifying questions while listening are suitable expansions. Broader labels such as attentive communication skills are omitted; a weak expansion is not needed when enough precise terms already cover the subject.
Learning plans are assembled in a single step. Suggested items contain no
rationale field and no per-item explanation is generated during search.
Collection titles, subtitles and plan phase descriptions remain available.
Use the on-demand rationale endpoint
to explain a selected learning; rationaleContext retains the original and
resolved search queries for that request.
Collection explanations and simulations¶
Learning-plan phases use the configured mini profile. The application supplies
the ordered schedule in days, weeks or months; generated titles retain those
boundaries and use localized units followed by numeric positions, such as
Month 1: Foundations, Weeks 1–2: SQL foundations or, in French,
Semaines 1 à 2 : Bases de SQL. Titles have no extra phase number or list marker.
The numbers identify positions in the plan, not elapsed durations.
Descriptions retain a concrete milestone, the reason for the phase's position
and one or two suggested practice activities outside the courses. The phase
assignment continues to use every selected training exactly once.
One call using the configured default profile generates the title, a concise
subtitle targeting 30 words or fewer, and an optional simulation suggestion.
Small word-count overruns are acceptable when the subtitle remains clear,
relevant and grounded. The prompt includes
each selected course's title, provider, level and duration, plus up to 600
characters of description and ten skill titles capped at 80 characters each.
These fields come from the existing search results; no additional retrieval is
needed. The configured provider and reasoning settings remain authoritative.
The subtitle connects the user's goal to documented course content and a concrete use. Personalization uses only supplied request or profile facts. Sparse metadata must produce a limited explanation rather than invented activities or outcomes. Excerpts and skill lists may be incomplete.
A simulation needs a distinct task and learning benefit beyond the activities already described across the selection. Renaming an exercise or changing sample data is insufficient. If the evidence does not establish that benefit, the model is instructed to disable the simulation and leave its title and description empty. The same rule applies to structured learning plans; missing catalogue detail is not evidence that a course lacks practice. These semantic criteria are prompt instructions assessed by the evaluation judge, not deterministic similarity checks.
When the user explicitly wants to practise a conversational situation and the selected training explicitly offers theory without corresponding role-play or interactive practice, the assistant proposes a complementary simulation. For example, a difficult-feedback request paired with a lecture without role-play warrants a simulated conversation applying observations, impact and a concrete request. The simulation is described separately from the course; a particular counterpart reaction or adaptation step is optional. This rule does not justify duplicating existing practice or inferring its absence from missing metadata.
Visibility¶
The user's trainingAccessGroup, every trainingHistory entry, dislikes,
requested content language and availability are applied to both retrieval
paths. History exclusion does not depend on completionDate: completed and
in-progress trainings are both omitted from ordinary recommendations and
learning plans. Training visibility never reads the PwC opportunity-only
accessGroup field.
The first hybrid search uses the requested catalog locale. If its fused candidate list is empty, both the vector and full-text searches run once more without either the requested locale or a language inferred from the natural-language request. Availability, access, history, dislike, provider, duration and explicit ID filters remain active on that second pass. Search failures propagate and do not trigger the fallback. A user with no training access groups does not receive an artificial empty-access restriction.