ReasonFlow includes an abstract CRM layer with a mock implementation for development and a pluggable adapter pattern for production CRM systems.
CRMBase (Abstract)
├── MockCRM (in-memory dict, for dev/testing)
├── SalesforceCRM (future)
└── HubSpotCRM (future)
class CRMBase(ABC):
async def get_contact(email: str) -> Contact | None
async def update_contact(email: str, data: dict) -> Contact
async def search_contacts(query: str) -> list[Contact]Pre-loaded with sample contacts for development:
- In-memory dictionary storage
- Supports all CRUD operations
- Seeded with test data on initialization
| Method | Path | Description |
|---|---|---|
| GET | /crm/contacts/{email} | Get contact by email |
| PUT | /crm/contacts/{email} | Update contact data |
CRM tools registered in ToolManager:
get_contact— fetches sender information before generating responseupdate_contact— updates contact record after interaction
{
"email": "alice@example.com",
"name": "Alice Smith",
"company": "Acme Corp",
"title": "VP of Engineering",
"last_interaction": "2026-01-20T10:00:00Z",
"notes": "Interested in enterprise plan",
"tags": ["prospect", "enterprise"]
}