Persona Manager โ Function-call index
Seeded by migration 1746000000011-SeedPersonaManagerFunctions.ts. Versioned via the tavus_function_definitions table; new versions are published from the SuperAdmin UI at /ops/personas/function-calls.
Onboarding (6)โ
| Name | Description |
|---|---|
record_environment_fact | Captures one stable property of the operating environment. category โ {systems, process, data, vocabulary, metrics}. |
record_guardrail | A rule the Specialist must follow. kind โ {must_do, must_not_do, escalation_trigger, compliance}, severity โ {low, medium, high, critical}. |
record_stakeholder | A person or role the Specialist will interact with. |
flag_follow_up_question | A question the Specialist couldn't fully resolve in the call. |
generate_onboarding_summary | The closing summary โ flips the EnvironmentProfile to pending_approval. |
escalate_to_supervisor | An issue out of scope for the Specialist โ captured as a high-priority follow-up. |
Handler implementations live at api/src/environment-profiles/handlers/onboarding-handlers.ts. Each writes to environment_profiles.data.<bucket> via EnvironmentProfilesService.appendToBucket or setBucket. Every mutation is audited via the existing AuditService.log.
Reporting (6)โ
| Name | Description |
|---|---|
log_manager_decision | Records a decision. Writes BOTH meeting_decisions AND the existing actions table (actorType=reporting_meeting, actionType=decision_logged). |
update_priorities | Captures a fresh priority list. One meeting_priorities row per entry. |
raise_escalation | When conversation_id is supplied โ routes through ExpertQueueService.createQueueItem. Without it โ captured as a high-priority follow-up on the environment profile. |
flag_environment_change | A change to the operating environment surfaced mid-meeting โ does NOT auto-edit the profile; recorded as a follow-up for the operator. |
note_feedback_for_specialist | Captures feedback signal via AuditService.log (resourceType=meeting, action=meeting.feedback_noted). |
schedule_next_checkin | Sets meeting.metadata.next_checkin_* and audits. |
Handler implementations live at api/src/meetings/handlers/reporting-handlers.ts.
Action extension-point castโ
The existing ActorType and ActionType are TypeScript union types over a VARCHAR DB column. Persona-manager handlers cast 'reporting_meeting' as unknown as ActorType and 'decision_logged' as unknown as ActionType at the write site. The cast is local to new code; api/src/common/entities.ts is not modified. This is documented in ADR-0001 and the integration spec ยง4.
Idempotencyโ
Every function-call handler receives the Tavus idempotency key in its WebhookRouterService context. The router itself rejects duplicate deliveries before any handler runs (Redis SET NX EX with 24h TTL; in-memory fallback). Handlers additionally write the key to idempotency_key columns where present (meeting_decisions, meeting_priorities) so a second-delivery race that slips past the router still no-ops at the DB level via the partial unique index from migration 1746000000010.
Adding a new function callโ
- Add a row to
tavus_function_definitions(either via the SuperAdmin UI or a new seed migration). - Implement the handler in
api/src/environment-profiles/handlers/(onboarding) orapi/src/meetings/handlers/(reporting). - Register it in the corresponding
*Handlers.registerAll()method. - Cover it with a unit test against a mocked
WebhookRouterService. - Update this index.