⚡ TRINITY GRAPH: AGENTIC RAG PIPELINE SPEC

Architecture for Adele's Human-in-the-Loop Network Agent

⚠️ ARCHITECTURAL WARNING

Do not give an autonomous AI direct write access to your social media or email outbox.

If OpenClaw or any autonomous agent hallucinates a connection, misreads a social cue, or sends a generic "just checking in" message to a Harvey Specter-level founder, you will instantly burn your bridge nodes. The cost of a false positive in a high-trust network is catastrophic.

1. The Human-in-the-Loop RAG Architecture (The Right Way)

The AI does not send the message. The AI acts as your Context Engine. It reads the graph, synthesizes the variables, and writes the draft into your UI. You hit "Copy", paste it into WhatsApp/Email, and hit "Send" yourself.

The Pipeline Flow:

  1. Trigger: You click a [Draft Outreach] button on a WHO node in your Trinity app.
  2. Retrieval (RAG): Your app queries Firebase for:
    • The target WHO node properties (Superpower, Vector).
    • The EDGE properties connecting you to them (Context, ATP/Energy State, Last Interaction).
    • Any WHAT or WHAT IF nodes connected to that WHO.
  3. Generation: The app sends that structured JSON payload to the Claude API (or Gemini/OpenAI).
  4. Delivery: The LLM returns a 2-3 sentence draft in the UI. You edit it, copy it, and hit a [Log Interaction] button which manually resets the edge decay timer.

2. The Payload Schema (What the AI reads)

Pass this exact JSON structure to the LLM prompt. This is how the AI knows why you are reaching out, rather than just who you are reaching out to.

{ "target_node": { "name": "Wayne Wei", "superpower": "Robotics Sales", "cluster": "Hardware Ecosystem" }, "edge_context": { "met_at": "Founders Coffee", "energy_state": "Energizing (ATP high)", "days_since_interaction": 42 }, "connected_hypotheses": [ "WHAT IF: Cranberry applies hardware-sales velocity to Title Insurance software?" ] }

3. The System Prompt (Enforcing the Connector Archetype)

The LLM needs strict boundaries, or it will write terrible, generic emails. Use this system prompt:

SYSTEM: You are a ghostwriter for Adele, the technical cofounder of Cranberry Tech (Title Insurance software). She is a "Connector" archetype—she executes horizontal gene transfer, taking playbooks from one industry and applying them to another. TASK: Draft a 2-3 sentence outreach message to the provided Target. CONSTRAINTS (STRICT): 1. Do not ask for generic advice. Offer leverage or a specific hypothesis to test. 2. Reference the exact 'edge_context' (where they met, or the energy of the interaction). 3. Connect their 'superpower' to the 'connected_hypotheses'. 4. Tone: Founder-mode. Highly efficient, confident, direct. No corporate jargon. No "hope you are doing well."

4. The "Log Interaction" Button Fix

If your button doesn't work yet, you need to update the Firebase document for that specific edge. Tell Claude to implement this exact function logic:

// Example Firebase Update Logic async function logInteraction(edgeId) { const edgeRef = doc(db, 'connections', edgeId); await updateDoc(edgeRef, { last_interaction: Date.now(), tie_strength: 'strong' // Resets the decay visualizer }); // Trigger UI re-render to turn the edge line solid again }