Standard Operating Procedure: Double Tri-Search Verification
Overview
To ensure the highest accuracy and depth in automated storytelling, Engram enforces a “Double Tri-Search” verification process. This ensures that information is not only retrieved by the delegating agent (Elena) but also independently verified and enriched by the executing agent (Sage) before content generation.
The Flow
1. Primary Search & Delegation (Elena)
- Role: Business Analyst / Orchestrator
- Trigger: User request (e.g., “Tell me a story about…”)
- Action:
- Analyze Request: Identify key entities.
- Tri-Search: execute
search_memory(Keyword + Vector + Graph). - Synthesize: Create a rich context packet.
- Delegate: Call
delegate_to_sage(topic, context).
2. Secondary Verification Search (Sage)
- Role: Storyteller / Verifier
- Trigger: Receipt of delegation.
- Action:
- Receive Context: Accept topic and context from Elena.
- Verification Search: Independent execution of
search_memoryusing the topic as the query.- Goal: Find “narrative threads” or adjacent facts potentially missed in the initial pass.
- Pattern: “Trust but Verify”.
- Synthesis: Combine [Elena’s Context] + [Sage’s Findings].
- Generation: Feed combined context to Claude Opus.
Technical Implementation
- Elena: Prompt instruction to “always search before delegating”.
- Sage: Enforced code-level step in
generate_story_activity.- The workflow must perform a lookup on the
topicbefore calling the LLM. - Verification results are appended to the context with a header
## Verification Context (Sage Tri-Search).
- The workflow must perform a lookup on the
Benefits
- Reduced Hallucination: Two independent retrieval passes reduce the chance of missing critical facts.
- Contextual Depth: Elena finds “business” context; Sage finds “narrative” context.
- Resilience: If one agent’s search fails or is shallow, the second provides a safety net.