CRM Integration
Your voice agent remembers who calls. The built-in CRM recognizes returning callers, greets them by name, and automatically saves new contacts from conversation - no manual data entry required.
What the CRM does
The CRM works in three ways, all automatic:
1. Caller lookup at call start
When a call comes in, the gateway searches your CRM by phone number. If there's a match, the caller's name, company, and interaction history are injected into the AI's context before it says a word. The result: personalized greetings from the first syllable.
2. Auto-extraction from conversation
When a caller says "Hi, I'm John from Acme Corp", the gateway extracts the name and company directly from the transcript and saves it to the CRM. No tool call needed - it happens server-side for zero latency impact.
3. Post-call transcript logging
After each call (5+ seconds), a summary and full transcript are logged as an interaction on the contact's CRM record. Next time they call, the agent has full history.
The phone number is always pinned from the phone network, never from what the caller says. New contacts are tagged voice-caller automatically.
Enabling and disabling
CRM is enabled by default when the RelationshipHub tools are installed. To explicitly control it, set features.crmCapture in your config.json:
// config.json
{
"features": {
"crmCapture": true // or false to disable
}
}This single flag controls both the read path (caller lookup) and the write path (auto-extraction and transcript logging). When off, no CRM subprocess runs and no caller data is read or written.
When to turn it off
If your bot is a public information line (store hours, directions, general FAQ) where random callers don't need to be remembered, disable CRM. It avoids unnecessary subprocess calls and prevents coincidental phone-number matches from injecting unrelated contact profiles into a stranger's session.
You can also set the environment variable NINJA_TALK_CRM_CAPTURE=false in your .env file for the same effect.
How caller lookup works
The moment a call arrives, before the agent even picks up, here is what happens:
- The phone network delivers the caller's phone number (network-verified, not spoofable by the caller)
- The gateway fires a CRM search with a bounded 5-second deadline
- If a match is found, the contact profile (name, company, notes, recent interactions) is formatted into a compact text block
- That block is injected into the voice model session's system instruction before the greeting
- The agent speaks a personalized greeting: "Hey Sarah, good to hear from you again"
Cache hits resolve in under 1ms. Warm lookups take around 50ms. Even in the worst case, the 5-second deadline ensures the call always proceeds - if the lookup is slow, the agent greets without context and the profile is cached for next time.
If no match is found, the agent uses a neutral greeting from your playbook and waits for the caller to identify themselves.
How auto-save works
You don't need to ask callers to spell out their details. The gateway listens to the natural conversation and extracts identity information server-side:
- Name - "This is Michael", "My name is Sarah Chen"
- Company - "I'm calling from Acme Corp", "over at Riverside Dental"
- Email - "You can reach me at mike@acme.com"
Extraction is debounced - the gateway waits for a natural pause in the conversation before running extraction, so rapid-fire introductions get batched into a single save. Corrections are handled automatically: if a caller says "Actually, call me Mike" later in the call, the record updates.
All inputs are sanitized (HTML/code stripped, Unicode-safe name validation, field length limits enforced) before writing to the CRM. The phone number is always the network-verified one from the phone network, never something the caller dictates.
Viewing CRM data
Contacts are stored in the OpenClaw RelationshipHub CRM on your server. You can browse and search contacts through:
- Chat commands - Ask your bot "Show me the contact for 555-1234" or "Who called yesterday?"
- CRM search tool - The RelationshipHub skill provides full-text search across names, companies, and notes
- Direct file access - Contact records are stored as structured data in your OpenClaw workspace under
tools/relationship-hub/
Each contact record includes: name, phone, company, email, tags, interaction history (with timestamps and call summaries), and any custom notes your agent has saved.
Per-call CRM in outbound calls
When placing outbound calls via the API, the CRM lookup is skipped - you already know who you're calling. Instead, context is provided through task facts:
// Outbound call API request
{
"to": "+15551234567",
"purpose": "Follow up on proposal",
"targetName": "Sarah Chen",
"facts": [
"Sarah is the CTO at Acme Corp",
"She requested a callback about pricing",
"Last spoke 3 days ago about the enterprise plan"
]
}The targetName and facts fields inject directly into the agent's context, giving it full awareness of who it's calling and why. The agent opens with purpose: "Hi Sarah, I'm calling back about the pricing question you had on the enterprise plan."
After the outbound call ends, the transcript is still logged to the CRM under that contact's record (if a matching contact exists), so the history stays complete.
Tips for getting the most out of CRM
Keep data clean
Periodically review contacts tagged voice-caller. Merge duplicates, correct names the AI misheard, and add context the bot could not infer. Cleaner data means better greetings on the next call.
Use for appointment follow-ups
CRM records pair naturally with the appointment scheduler. When a caller books a meeting, the CRM stores the context. On follow-up calls, the agent already knows what was scheduled and can confirm or reschedule without asking the caller to repeat themselves.
Combine with your knowledge base
CRM tells the agent WHO is calling. The knowledge base tells it WHAT to say. Together, the agent can tailor responses: "Sarah, since you're on the enterprise plan, you actually get priority support for this."
Leverage interaction history
Every call summary is logged. After several interactions, the agent has a rich history to draw from: "Last time we spoke, you mentioned wanting to upgrade - did you get a chance to review the options?"
CRM is included with every TTMA agent
No extra plugins to install, no third-party integrations to configure. Your agent starts building its contact database from the very first call.
Get started