Files
leocrm/app/plugins/builtins/automation/prebuilt/contact_enrichment_agent.py
T
Agent Zero 8ed6d27885
Check Cross-Plugin Imports / check (push) Has been cancelled
feat(F): F-WORK agent_workstream + F-EMAIL/CONTACT/FOLLOW/REPORT prebuilt agents
- F-WORK: app/ai/agent_workstream.py (201 lines) — post_agent_message, post_agent_step, post_agent_result, post_approval_request
- F-EMAIL: prebuilt/email_triage_agent.py — E-Mail-Triage-Agent with 3 tools, max 10 steps, $0.50 budget
- F-CONTACT: prebuilt/contact_enrichment_agent.py — Contact-Enrichment-Agent with 3 tools, max 8 steps, $0.30 budget
- F-FOLLOW: prebuilt/follow_up_agent.py — Follow-up-Agent with 3 tools, max 8 steps, $0.30 budget
- F-REPORT: prebuilt/report_agent.py — Report-Agent with 2 tools, max 12 steps, $0.50 budget
- All compile checks pass
2026-08-17 18:33:45 +02:00

53 lines
1.7 KiB
Python

"""Pre-built Contact-Enrichment-Agent.
Enriches contact data by searching for related information.
"""
from __future__ import annotations
import uuid
from app.plugins.builtins.automation.models import AgentDefinition
CONTACT_ENRICHMENT_SYSTEM_PROMPT = """You are a Contact Enrichment Agent for a CRM system.
Your task is to enrich contact profiles with additional information.
For each contact, you should:
1. Search for related entities (companies, other contacts)
2. Check audit history for recent interactions
3. Find semantic matches in the database
4. Suggest missing fields that could be filled
5. Identify potential duplicates
Use the available tools to:
- Search for related entities (search_related)
- Get entity history (get_contact_history)
- Call CRM API for data lookup (call_crm_api)
Output format:
- Enrichment suggestions as structured data
- Confidence score for each suggestion
- Source reference for each piece of information
Do NOT modify contacts. You are advisory only.
"""
def create_contact_enrichment_agent(
tenant_id: uuid.UUID, user_id: uuid.UUID
) -> AgentDefinition:
return AgentDefinition(
tenant_id=tenant_id,
name="Contact-Enrichment-Agent",
description="Reichert Kontaktdaten mit verwandten Informationen an",
system_prompt=CONTACT_ENRICHMENT_SYSTEM_PROMPT,
llm_model="openai/gpt-4o-mini",
tool_ids=["search_related", "get_contact_history", "call_crm_api"],
max_steps=8,
max_duration_seconds=90,
budget_limit_usd=0.30,
mode="reactive",
is_active=True,
temperature=0.2,
max_tokens=1500,
trace_mode="standard",
created_by=user_id,
)