Customers
Customers
In Parlant, a customer is anyone who interacts with an agent.
While agents can operate anonymously (without knowing who they're talking to), tracking customers enables powerful personalization opportunities. By letting your agents understand who they're talking to, you can tailor interactions for different user segments: High-profile customers might receive premium offers, new users can get focused onboarding guidance, and so on...
Parlant makes customer-specific personalization simple and privacy-conscious, requiring only minimal identification of a specific customer—in fact, just a name.
- CLI
- Python
- TypeScript
$ parlant customer create \
--name "Scooby"
from parlant.client import ParlantClient
client = ParlantClient(base_url=SERVER_ADDRESS)
customer = client.customers.create(name="Scooby", extra={})
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
const customer = await client.customers.create({
name: "Scooby",
extra: {},
});
Tags
You can also divide your customers into different groups and control group-specific personalization by using tags. For example, you can create a tag for VIP customers:
- CLI
- Python
- TypeScript
$ parlant tag create \
--name "VIP"
$ parlant customer tag \
--id CUSTOMER_ID \
--tag-id TAG_ID
from parlant.client import ParlantClient, TagUpdateParams
client = ParlantClient(base_url=SERVER_ADDRESS)
tag = client.tags.create(name="VIP")
client.customers.update(
customer_id=CUSTOMER_ID,
tags=TagUpdateParams(add=[tag.id]),
)
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
const tag = await client.tags.create({
name: "VIP",
});
await client.customers.update(CUSTOMER_ID, {
tags: { add: [tag.id] },
});
To learn more about advanced personalization possibilities for specific customers and groups, check out the context variables section.
API Highlights
Viewing a customer
- CLI
- Python
- TypeScript
$ parlant customer view \
--id CUSTOMER_ID
from parlant.client import ParlantClient
client = ParlantClient(base_url=SERVER_ADDRESS)
customer = client.customers.retrieve(CUSTOMER_ID)
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
const customer = await client.customers.retrieve(CUSTOMER_ID);
Updating a customer
- CLI
- Python
- TypeScript
$ parlant customer update \
--id CUSTOMER_ID \
--name "Scooby"
$ parlant customer set \
--id CUSTOMER_ID \
--key email \
--value CUSTOMER_EMAIL
from parlant.client import ParlantClient, CustomerExtraUpdateParams
client = ParlantClient(base_url=SERVER_ADDRESS)
customer = client.customers.update(
CUSTOMER_ID,
name="Scooby",
extra=CustomerExtraUpdateParams(add={"email": CUSTOMER_EMAIL}),
)
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
const customer = await client.customers.update(CUSTOMER_ID, {
name: "Scooby",
extra: {add: {email: CUSTOMER_EMAIL}},
});
Deleting a customer
- CLI
- Python
- TypeScript
$ parlant customer delete \
--id CUSTOMER_ID
from parlant.client import ParlantClient
client = ParlantClient(base_url=SERVER_ADDRESS)
client.customers.delete(CUSTOMER_ID)
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
await client.customers.delete(CUSTOMER_ID);