Skip to content

CRM

nodyn includes a built-in CRM combining the Knowledge Graph (semantic understanding of people and companies) with DataStore tables (structured deal pipeline and interaction tracking).

Knowledge Graph (automatic)
→ Entities: "Lisa Weber works at Acme AG"
→ Relationships: "Acme AG interested in Pro Package"
→ Primary source for "what do I know about X?"
DataStore (agent-driven)
→ contacts: tracked when business-relevant
→ deals: pipeline with stages and values
→ interactions: significant touchpoints logged
Agent decides
→ Recognizes business-relevant person → adds to contacts
→ User discusses opportunity → creates deal
→ Important call/meeting → logs interaction
→ NOT every Telegram message is tracked

The CRM schema is created on first Engine startup. Contact creation is agent-driven, not automatic.

Three DataStore tables, auto-created:

ColumnTypeDescription
namestringContact name (unique key, used for upsert)
emailstringEmail address
phonestringPhone number
companystringCompany/organization
typestringprospect, lead, customer, partner, other
sourcestringtelegram, email, web, manual
channel_idstringExternal ID (e.g. telegram:12345)
languagestringPreferred language (auto-detected from Telegram)
notesstringFree-text notes
ColumnTypeDescription
titlestringDeal name (unique with contact_name)
contact_namestringAssociated contact
valuenumberDeal value
currencystringCurrency (default: CHF)
stagestringPipeline stage
next_actionstringNext step to take
due_datedateDeadline for next action

Pipeline stages: leadqualifiedproposalnegotiationwon / lost

ColumnTypeDescription
contact_namestringAssociated contact
typestringmessage, email, call, meeting, note
channelstringtelegram, email, web, manual
summarystringInteraction summary (auto-truncated)
datedateTimestamp

Contacts are NOT auto-created from every message. The agent decides when someone is business-relevant:

  • User mentions “Lisa from Acme called about pricing” → agent recognizes business relevance, creates contact + logs interaction
  • User sends a casual test message → nothing tracked
  • User says “Add Roland as a lead” → agent creates contact explicitly

The Knowledge Graph automatically captures people and companies mentioned in any conversation. The DataStore contacts table is for explicit business tracking (leads, pipeline).

You interact with the CRM through natural conversation:

"Zeig mir alle meine Leads"
→ data_store_query on contacts WHERE type = 'lead'
"Erstelle einen Deal für Lisa: Pro Paket, CHF 4800"
→ data_store_insert into deals
"Wie steht meine Pipeline?"
→ data_store_query on deals, aggregation by stage
"Erinnere mich in 3 Tagen bei Roland nachzufragen"
→ task_create with due_date + contact context
"Was weiß ich über Acme AG?"
→ Knowledge Graph: relationships + DataStore: contact + deals + interactions

The CRM data is automatically indexed in the Knowledge Graph:

  • Contact entities: “Lisa Weber works at Acme AG”
  • Relationships: “Acme AG is a customer since March 2026”
  • Context: “Roland prefers email communication”
  • Deal history: “v-skin.ch Pro deal at CHF 4800 in negotiation”

This means when you ask “What do I know about Roland?”, nodyn combines structured CRM data with semantic knowledge.

CRM data is stored in standard DataStore tables. Use existing commands:

Terminal window
/data list # See contacts, deals, interactions tables

Or ask the agent directly — it knows about the CRM tables and can query them.

import { Engine, CRM } from '@nodyn-ai/core';
const engine = new Engine({});
await engine.init();
const crm = engine.getCRM();
// Agent-driven contact creation
crm.upsertContact({
name: 'Lisa Weber',
email: 'lisa@acme.ch',
company: 'Acme AG',
type: 'lead',
source: 'telegram',
});
// Create a deal
crm.upsertDeal({
title: 'Pro Package',
contact_name: 'Lisa Weber',
value: 4800,
stage: 'proposal',
due_date: '2026-04-01T00:00:00Z',
});
// Query pipeline
const pipeline = crm.getPipelineSummary();
// → [{ stage: 'proposal', count: 1, total_value: 4800 }]
// Log interaction
crm.logInteraction({
contact_name: 'Lisa Weber',
type: 'email',
channel: 'email',
summary: 'Sent proposal for Pro Package',
});

No configuration needed. The CRM is initialized automatically when the DataStore is available. To disable, don’t initialize the DataStore (set via Engine config).