Inferensys

Prompt

Chat Conversation to CRM Record Prompt Template

A practical prompt playbook for CRM integration engineers extracting customer details, intent, sentiment, and action items from chat transcripts into structured CRM payloads.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job, ideal user, required context, and when not to use the Chat Conversation to CRM Record prompt.

This prompt is designed for CRM integration engineers who need to convert unstructured chat transcripts into structured CRM payloads. The primary job-to-be-done is extracting customer details, intent, sentiment, and action items from a conversation and mapping them to standard CRM objects like Contacts, Opportunities, and Activities. The ideal user is a backend engineer or platform developer building an automated pipeline that ingests chat logs from Intercom, Zendesk, or a custom chat widget and pushes normalized records into Salesforce, HubSpot, or a similar system of record.

Use this prompt when you have a complete, self-contained chat transcript and a known target CRM schema. The prompt expects [CONVERSATION_TRANSCRIPT] as raw text, [CRM_SCHEMA] defining the target fields and their types, and [COMPANY_CONTEXT] providing account-specific defaults like the CRM owner ID or standard picklist values. It is most effective when the transcript includes clear participant roles, timestamps, and a coherent thread. The prompt includes instructions for entity resolution against existing records and duplicate detection, making it suitable for pipelines that must avoid creating redundant contacts or opportunities.

Do not use this prompt for real-time, streaming chat where the conversation is incomplete, or for transcripts that mix multiple unrelated customer threads. It is also not a replacement for a proper CRM API integration—the output is a structured payload that still requires validation, deduplication logic, and an upsert strategy in your application layer. If the transcript contains sensitive PII that should not be processed by a third-party model, handle redaction before the prompt or use a local deployment. For high-volume production use, pair this prompt with a confidence threshold eval and a human review queue for records flagged as ambiguous or low-confidence.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Chat Conversation to CRM Record prompt template is the right tool for your integration.

01

Good Fit: Structured CRM Ingestion

Use when: You have a complete chat transcript and need to extract a single, well-defined CRM record (contact, opportunity, activity) for ingestion into a system of record. Guardrail: The prompt expects a clear target schema; always validate the output against your CRM's API contract before upserting.

02

Bad Fit: Real-Time Agent Copilot

Avoid when: You need a low-latency, streaming suggestion for an agent during a live conversation. This prompt is designed for post-conversation batch repair, not interactive use. Guardrail: For real-time use, switch to a function-calling pattern that emits incremental tool calls rather than a single post-hoc extraction.

03

Required Inputs

What you must provide: A full chat transcript, a target CRM object schema (e.g., Contact, Opportunity), and a list of required fields. Guardrail: Without a schema, the model will invent fields. Always pass the exact field names and types your downstream system expects to prevent mapping errors.

04

Operational Risk: Duplicate Records

What to watch: The model may extract a contact that already exists in your CRM, creating duplicates if you auto-ingest without checking. Guardrail: Implement a pre-upsert entity resolution step (email/domain matching) and flag potential duplicates for human review before creating new records.

05

Operational Risk: Hallucinated Fields

What to watch: The model may populate fields like 'deal amount' or 'close date' with plausible but fabricated values when the transcript is ambiguous. Guardrail: Require explicit source grounding for high-stakes fields. If a value cannot be traced to a specific utterance, leave it null and flag it for manual entry.

06

Variant: Multi-Entity Extraction

What to watch: A single transcript may reference multiple contacts, companies, or deals. A prompt expecting one record will silently drop entities. Guardrail: If your use case involves multiple parties, use a variant of this prompt that extracts an array of records and includes a deduplication step based on unique identifiers.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for converting chat transcripts into structured CRM payloads, ready for adaptation and integration.

This template is the core instruction set for extracting structured CRM data from a raw chat conversation. It is designed to be dropped into your application's prompt layer, with placeholders that your system must populate at runtime. The prompt instructs the model to parse the transcript, identify entities, and output a clean JSON payload that matches a target CRM schema. It also includes explicit instructions for handling ambiguity, detecting duplicates, and flagging low-confidence extractions, which are critical for maintaining CRM data integrity.

text
You are an expert CRM data extraction system. Your task is to analyze the provided chat transcript and produce a structured JSON payload for CRM ingestion.

### INPUT
Chat Transcript:
[CHAT_TRANSCRIPT]

### OUTPUT SCHEMA
You must output a single, valid JSON object conforming to this structure. Do not include any text outside the JSON object.
{
  "contact": {
    "full_name": "string | null",
    "email_address": "string | null (must be a valid email format)",
    "phone_number": "string | null (E.164 format preferred)",
    "company_name": "string | null"
  },
  "opportunity": {
    "name": "string | null",
    "stage": "string | null (one of: 'Prospecting', 'Qualification', 'Proposal', 'Closed Won', 'Closed Lost')",
    "amount": "number | null",
    "close_date": "string | null (ISO 8601 date YYYY-MM-DD)"
  },
  "activity": {
    "type": "string | null (one of: 'Call', 'Email', 'Meeting', 'Chat')",
    "subject": "string | null",
    "notes": "string | null (a concise summary of the conversation)"
  },
  "intent": {
    "primary_intent": "string | null (e.g., 'Support', 'Sales Inquiry', 'Complaint', 'General Question')",
    "sentiment": "string | null (one of: 'Positive', 'Neutral', 'Negative')"
  },
  "action_items": [
    {
      "description": "string",
      "assignee": "string | null",
      "due_date": "string | null (ISO 8601 date YYYY-MM-DD)"
    }
  ],
  "flags": [
    "string (e.g., 'DUPLICATE_DETECTED', 'LOW_CONFIDENCE_CONTACT', 'ESCALATION_REQUIRED')"
  ]
}

### CONSTRAINTS
- Extract only information explicitly stated or strongly implied in the transcript. Do not invent details.
- If a field's value is not present, return `null` for that field.
- For the `opportunity.stage`, infer the most logical stage based on the conversation. If unclear, return `null`.
- If you detect that the contact's email or phone matches an existing record, add the `DUPLICATE_DETECTED` flag.
- If you are unsure about the accuracy of a key extraction (like a name or company), add the `LOW_CONFIDENCE_CONTACT` flag.
- If the customer expresses significant frustration or a legal threat, add the `ESCALATION_REQUIRED` flag.
- Ensure all dates are in ISO 8601 YYYY-MM-DD format.

### EXAMPLES
Input Transcript:
"Hi, this is Sarah from Acme Corp. I need a quote for 50 licenses."
Output:
{
  "contact": { "full_name": "Sarah", "company_name": "Acme Corp", ... },
  "opportunity": { "stage": "Prospecting", ... },
  ...
}

To adapt this template, replace the [CHAT_TRANSCRIPT] placeholder with the actual conversation text. You can tighten the OUTPUT_SCHEMA to match your specific CRM's API contract exactly, adding or removing fields as needed. The CONSTRAINTS section is your primary lever for controlling data quality; add rules specific to your business logic, such as validating against a list of known competitors or enforcing specific deal stages. The EXAMPLES section should be populated with 2-3 representative transcripts and their ideal outputs to significantly improve accuracy through few-shot learning. Before deploying, run this prompt against a golden dataset of 50 transcripts and measure field-level accuracy, especially for the flags array, as incorrect flags can create significant downstream noise for your sales team.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Chat Conversation to CRM Record prompt. Validate each before calling the model to prevent runtime failures and ensure consistent entity resolution.

PlaceholderPurposeExampleValidation Notes

[CHAT_TRANSCRIPT]

Full conversation text to extract CRM data from

Customer: I need to update my billing address... Agent: Certainly, what's the new address?

Required. Must be non-empty string. Check for minimum 50 characters to ensure sufficient context. Reject if only metadata without conversation body.

[CRM_SCHEMA]

Target CRM object schema defining required fields, types, and enums

{"contact": {"fields": ["name", "email", "phone"]}, "opportunity": {"fields": ["amount", "stage"]}}

Required. Must be valid JSON. Validate against expected CRM object types (contact, opportunity, activity). Reject if missing required field definitions.

[ENTITY_RESOLUTION_CONTEXT]

Existing CRM records to match against for deduplication

{"existing_contacts": [{"id": "C001", "name": "Acme Corp", "email": "contact@acme.com"}]}

Optional. If provided, must be valid JSON array of existing records. Use to prevent duplicate creation. Null allowed for net-new conversations.

[CONFIDENCE_THRESHOLD]

Minimum confidence score for field extraction before flagging for human review

0.85

Optional. Float between 0.0 and 1.0. Default to 0.80 if not specified. Fields below threshold should be returned with low_confidence flag set to true.

[OUTPUT_FORMAT]

Desired output structure for the CRM payload

{"format": "json", "include_activity_log": true, "include_sentiment": true}

Required. Must specify format type. Boolean flags for optional sections (activity_log, sentiment, intent). Validate format is supported by downstream CRM API.

[DUPLICATE_DETECTION_RULES]

Criteria for identifying duplicate contacts or opportunities

{"match_on": ["email", "phone"], "fuzzy_match": true, "fuzzy_threshold": 0.90}

Optional. If provided, must specify match fields. Fuzzy matching requires threshold. Used to prevent duplicate CRM records. Null allowed for new-only workflows.

[REQUIRED_INTENTS]

List of intents to classify from the conversation

["billing_update", "support_request", "sales_inquiry", "account_cancellation"]

Optional. If provided, must be non-empty array of intent labels. Model must classify conversation into one or more of these intents. Null allowed if intent classification not needed.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Chat Conversation to CRM Record prompt into a reliable application pipeline with validation, retries, and human review gates.

This prompt is designed to sit inside a post-generation repair loop, not as a standalone call. The typical integration pattern is: (1) receive a chat transcript, (2) attempt structured extraction with a primary prompt, (3) validate the output against the CRM schema, and (4) if validation fails or the model returns prose instead of JSON, invoke this repair prompt with the failed output and the original transcript. The repair prompt expects both [ORIGINAL_TRANSCRIPT] and [FAILED_OUTPUT] as inputs, along with the [CRM_SCHEMA] defining required fields, types, and enum values for contact, opportunity, and activity records.

Wire the prompt into a retry pipeline with a maximum of two repair attempts before escalating to a human review queue. After each repair attempt, validate the output against the CRM schema using a deterministic validator—check for required field presence, correct types, valid enum values, and duplicate detection flags. Log every repair attempt with the original transcript ID, the failed output, the repair prompt version, and the validation result. For high-confidence duplicate detection (confidence > 0.85), route to a merge-review queue rather than auto-creating records. Use a model with strong JSON mode support (e.g., GPT-4o, Claude 3.5 Sonnet) and set response_format to json_object to reduce format drift. If the model still returns prose after two repair attempts, log the failure and surface the transcript to a human operator with the partial extraction results pre-filled.

The most common production failure mode is entity resolution—the model creates a new contact when an existing one matches. Mitigate this by passing a [KNOWN_CONTACTS] list into the prompt context and requiring the model to output a duplicate_of field with a confidence score. For CRM systems with strict write permissions, implement a two-stage pipeline: first extract and resolve entities, then generate the CRM payload only after entity resolution is confirmed. Never auto-commit records with confidence < 0.7 or duplicate_of scores in the ambiguous range (0.4–0.6). These should always route to human review with the evidence highlighted.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the exact shape of the CRM record produced by the prompt. Use this contract to validate outputs before they enter your CRM system.

Field or ElementType or FormatRequiredValidation Rule

contact.email

string (RFC 5322)

Regex match against standard email pattern; reject if missing or malformed

contact.name

string

Must be non-empty and extracted from transcript; reject if hallucinated without source evidence

contact.phone

string (E.164 preferred)

If present, strip non-digit characters and validate length >= 10; null allowed

opportunity.title

string

Must be a concise summary derived from conversation topic; max 200 chars; reject if generic placeholder

opportunity.stage

enum: [Prospecting, Qualification, Proposal, Negotiation, Closed Won, Closed Lost]

Must match one of the allowed enum values exactly; case-sensitive check

activity.type

enum: [Call, Email, Meeting, Chat, Note]

Must match allowed enum; default to 'Chat' if conversation is text-based and type is ambiguous

activity.summary

string

Must contain 2-5 sentences grounded in transcript content; reject if summary contains facts not present in source

intent.primary

enum: [Purchase, Support, Inquiry, Complaint, Renewal, Other]

Classification must be inferable from transcript; if confidence is low, set to 'Inquiry' and flag for review

sentiment.score

integer (-5 to 5)

Must be within range; validate numeric type; if sentiment is mixed, use 0 and include sentiment.notes

action_items

array of objects

Each item must have description (string), owner (string), and deadline (ISO 8601 or null); reject items with no source grounding

PRACTICAL GUARDRAILS

Common Failure Modes

Chat-to-CRM extraction fails in predictable ways. These are the most common production failure modes and how to guard against them before they corrupt your CRM records.

01

Entity Hallucination

What to watch: The model invents contact names, company names, or deal amounts that never appeared in the chat transcript. This is especially common when the conversation is vague or the model tries to fill gaps in required CRM fields. Guardrail: Require the model to cite the exact transcript segment for every extracted entity. If no evidence exists, the field must be null—never guessed. Add a post-extraction validator that flags any populated field without a corresponding source citation.

02

Duplicate Record Creation

What to watch: The model extracts a contact or company that already exists in the CRM but fails to recognize it, creating a duplicate record instead of updating the existing one. This happens when the prompt lacks entity resolution context or the model ignores provided CRM search results. Guardrail: Always pass existing CRM search results (contacts, companies, opportunities) as context before extraction. Instruct the model to match against these results first and output a match_id field. Add a deduplication check in the harness that queries the CRM API before any create operation.

03

Sentiment-to-Score Drift

What to watch: The model extracts correct sentiment language but maps it to the wrong CRM sentiment score or category—for example, labeling a mildly frustrated customer as 'Detractor' or a politely neutral message as 'Promoter.' Guardrail: Provide explicit scoring rubrics with examples in the prompt (e.g., 'Only label as Detractor when the customer explicitly threatens to leave or requests cancellation'). Add a post-extraction validator that checks for score-text consistency by comparing the sentiment label against keyword and phrase patterns in the source transcript.

04

Action Item Ownership Gaps

What to watch: The model extracts action items and deadlines correctly but fails to assign ownership or assigns the wrong person—often defaulting to the customer when the internal rep should own the task. Guardrail: Include a participant role map in the prompt context that identifies who is the customer and who is the internal rep. Instruct the model to default action item ownership to the internal rep unless the customer explicitly agrees to take an action. Validate that every extracted action item has a non-null owner field.

05

Temporal Misalignment

What to watch: The model extracts relative dates ('next Tuesday,' 'end of month') as absolute dates without knowing the conversation timestamp, or misinterprets timezone-ambiguous phrases. This creates follow-up tasks with wrong due dates and opportunity close dates in the wrong quarter. Guardrail: Always pass the conversation timestamp and timezone as explicit context. Instruct the model to resolve all relative dates against this reference and output ISO 8601 timestamps. Add a validator that flags any date that falls outside a reasonable window relative to the conversation date.

06

Partial Transcript Truncation

What to watch: Long chat transcripts exceed the model's context window or get truncated by upstream systems, causing the model to extract records from only the visible portion while silently missing critical details from the truncated section. Guardrail: Implement a context-length check before extraction. If the transcript exceeds the safe token budget, split it into overlapping chunks, extract from each, and merge results with deduplication. Add a completeness flag to the output that indicates whether the full transcript was processed or only a partial view.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of CRM records generated from chat transcripts before shipping. Each criterion targets a specific failure mode common in unstructured-to-structured conversion. Run these checks in your eval harness after every prompt or model change.

CriterionPass StandardFailure SignalTest Method

Entity Resolution Accuracy

Contact and company names match input transcript exactly; no fabricated names or aliases

Output contains a name not present in [CHAT_TRANSCRIPT]; model hallucinates a company or contact

Exact string match against source transcript entities; flag any name with Levenshtein distance > 0 unless explicitly normalized

Duplicate Detection

Output correctly identifies and merges duplicate contacts or companies mentioned with variant names in transcript

Same real-world entity appears as two separate CRM records; model fails to recognize 'Bob' and 'Robert' as same person

Provide transcript with known duplicate variants; assert deduplicated output has single record per entity; check merge confidence flag is true

Field Completeness

All required CRM fields are populated with non-null values when evidence exists in transcript

Required field like [CONTACT_EMAIL] or [OPPORTUNITY_AMOUNT] is null despite clear mention in transcript

Schema validation against [CRM_SCHEMA]; assert required fields are not null when source evidence is present; log missing-field rate

Intent Classification

Primary customer intent is correctly classified into one of the allowed [INTENT_CATEGORIES] enum values

Intent is classified as 'general_inquiry' when transcript shows clear purchase intent; or output uses category outside allowed enum

Assert output intent field is in [INTENT_CATEGORIES] list; spot-check 20 samples for intent-transcript alignment; measure precision at 0.95

Sentiment Score Calibration

Sentiment score reflects transcript tone; positive, negative, neutral boundaries are consistent with human judgment

Transcript contains angry escalation language but output sentiment is 'positive' or 'neutral'; score is inverted

Compare model sentiment label against human-annotated gold set; require Cohen's kappa >= 0.8; flag polarity inversions as hard failures

Action Item Extraction

All explicit action items, owners, and deadlines from transcript are captured; no invented tasks

Output includes action item 'Send contract by Friday' but transcript says 'I'll send the contract next week'; owner mismatch or hallucinated deadline

Extract action items from transcript manually; assert output action items are subset of transcript items; flag precision < 1.0 or recall < 0.9

Activity Log Timestamp Ordering

Activity log entries are in chronological order with timestamps parsed from transcript message times

Activity log shows 'follow-up call' before 'initial meeting' despite transcript order; timestamp parsing produces future dates

Assert activity log array is sorted by timestamp ascending; validate all timestamps parse without error; flag any out-of-order entries

Output Schema Conformance

Entire output payload validates against [OUTPUT_SCHEMA] with no extra fields, missing required fields, or type errors

Output contains hallucinated field 'customer_rating' not in schema; [OPPORTUNITY_STAGE] is integer instead of string enum

Run JSON Schema validator against output; assert validation passes with zero errors; block deployment on schema violation rate > 0%

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single example and minimal output schema. Focus on getting the core extraction right before adding CRM-specific field mappings.

code
Extract from [CHAT_TRANSCRIPT]:
- Contact: name, email, phone
- Intent: primary reason for contact
- Sentiment: positive/neutral/negative
- Action items: list of next steps

Return JSON only.

Watch for

  • Missing entity resolution when names appear in multiple forms
  • Overly broad intent classification without CRM category mapping
  • No duplicate detection logic
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.