@personize/sdk 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -81
- package/dist/client.d.ts +1 -9
- package/dist/client.js +0 -22
- package/dist/types.d.ts +9 -45
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -43,8 +43,6 @@ console.log(me.data.plan.limits);
|
|
|
43
43
|
| POST | `/api/v1/smart-recall` | `client.memory.smartRecall(opts)` |
|
|
44
44
|
| POST | `/api/v1/recall` | `client.memory.recall(opts)` |
|
|
45
45
|
| POST | `/api/v1/search` | `client.memory.search(opts)` |
|
|
46
|
-
| POST | `/api/v1/upsert` | `client.memory.upsert(opts)` |
|
|
47
|
-
| POST | `/api/v1/upsert` | `client.memory.upsertBatch(opts)` |
|
|
48
46
|
| POST | `/api/v1/batch-memorize` | `client.memory.memorizeBatch(opts)` |
|
|
49
47
|
| POST | `/api/v1/smart-memory-digest` | `client.memory.smartDigest(opts)` |
|
|
50
48
|
| **Guidelines** | | |
|
|
@@ -170,8 +168,9 @@ console.log(research.data?.evaluation?.finalScore);
|
|
|
170
168
|
|
|
171
169
|
```typescript
|
|
172
170
|
// Memorize content (dual extraction: structured + free-form)
|
|
171
|
+
// Tip: prepend identity field hints to ensure demographic properties are captured
|
|
173
172
|
await client.memory.memorize({
|
|
174
|
-
content: '
|
|
173
|
+
content: 'Also extract First Name, Company Name, and Job Title if mentioned.\n\nMeeting notes: John prefers email contact. He is VP of Sales at Acme Corp.',
|
|
175
174
|
speaker: 'Sales Rep',
|
|
176
175
|
enhanced: true,
|
|
177
176
|
tags: ['meetings'],
|
|
@@ -194,11 +193,14 @@ const fast = await client.memory.smartRecall({
|
|
|
194
193
|
fast_mode: true,
|
|
195
194
|
});
|
|
196
195
|
|
|
197
|
-
// Direct recall —
|
|
196
|
+
// Direct recall — DynamoDB lookup: properties + freeform memories (no AI, type required)
|
|
198
197
|
const direct = await client.memory.recall({
|
|
199
198
|
query: 'What do we know about Acme?',
|
|
199
|
+
type: 'Contact',
|
|
200
200
|
email: 'john@acme.com',
|
|
201
201
|
});
|
|
202
|
+
// direct.data.memories — structured properties from Snapshot
|
|
203
|
+
// direct.data.freeformMemories — AI-extracted memories from Freeform table
|
|
202
204
|
|
|
203
205
|
// Search/filter records by property conditions
|
|
204
206
|
const found = await client.memory.search({
|
|
@@ -209,15 +211,17 @@ const found = await client.memory.search({
|
|
|
209
211
|
pageSize: 50,
|
|
210
212
|
});
|
|
211
213
|
|
|
212
|
-
// Batch sync — unified call with per-property extractMemories
|
|
214
|
+
// Batch sync — unified call with per-property extractMemories control
|
|
215
|
+
// IMPORTANT: Set extractMemories: true on rich text fields (notes, transcripts, descriptions)
|
|
216
|
+
// to enable AI extraction and semantic search. Without it, only structured storage occurs.
|
|
213
217
|
await client.memory.memorizeBatch({
|
|
214
218
|
source: 'Hubspot',
|
|
215
219
|
mapping: {
|
|
216
220
|
entityType: 'contact',
|
|
217
221
|
email: 'email',
|
|
218
222
|
properties: {
|
|
219
|
-
email: { sourceField: 'email', collectionId: 'col_std', collectionName: 'Standard' },
|
|
220
|
-
full_name: { sourceField: 'fullname', collectionId: 'col_std', collectionName: 'Standard' },
|
|
223
|
+
email: { sourceField: 'email', collectionId: 'col_std', collectionName: 'Standard', extractMemories: false },
|
|
224
|
+
full_name: { sourceField: 'fullname', collectionId: 'col_std', collectionName: 'Standard', extractMemories: false },
|
|
221
225
|
notes: { sourceField: 'notes', collectionId: 'col_gen', collectionName: 'Generated', extractMemories: true },
|
|
222
226
|
},
|
|
223
227
|
},
|
|
@@ -234,16 +238,6 @@ const digest = await client.memory.smartDigest({
|
|
|
234
238
|
});
|
|
235
239
|
console.log(digest.data?.compiledContext); // ready-to-use markdown for LLM prompts
|
|
236
240
|
|
|
237
|
-
// Structured upsert — no AI extraction
|
|
238
|
-
await client.memory.upsert({
|
|
239
|
-
type: 'Contact',
|
|
240
|
-
properties: {
|
|
241
|
-
email: { value: 'john@acme.com', collectionId: 'col_123' },
|
|
242
|
-
company: { value: 'Acme Corp' },
|
|
243
|
-
},
|
|
244
|
-
matchKeys: { email: 'john@acme.com' },
|
|
245
|
-
source: 'crm-sync',
|
|
246
|
-
});
|
|
247
241
|
```
|
|
248
242
|
|
|
249
243
|
### Agents
|
|
@@ -336,7 +330,7 @@ const client = new Personize({
|
|
|
336
330
|
**New in 0.4.0:**
|
|
337
331
|
- `client.test()` — Verify API key validity
|
|
338
332
|
- `client.agents.get(id)` — Get agent details and expected inputs
|
|
339
|
-
- `client.memory.recall(opts)` — Direct
|
|
333
|
+
- `client.memory.recall(opts)` — Direct DynamoDB lookup: properties + freeform memories (no AI)
|
|
340
334
|
- `client.memory.search(opts)` — Search/filter records with `property`-based conditions
|
|
341
335
|
- `client.evaluate.memorizationAccuracy(opts)` — Three-phase memorization evaluation
|
|
342
336
|
- `attachments` on `PromptOptions` — Multimodal support (images, PDFs, documents)
|
|
@@ -346,69 +340,10 @@ const client = new Personize({
|
|
|
346
340
|
|
|
347
341
|
## Skills
|
|
348
342
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
### Integration Builder (`skills/integrations/`)
|
|
352
|
-
|
|
353
|
-
Build CRM/database sync integrations. Connect Salesforce, HubSpot, Postgres, or any data source to Personize memory with batch memorization and scheduled deployment.
|
|
354
|
-
|
|
355
|
-
```
|
|
356
|
-
skills/integrations/
|
|
357
|
-
├── CLAUDE.md # Main skill instructions
|
|
358
|
-
├── templates/
|
|
359
|
-
│ ├── salesforce.md # Salesforce connector pattern
|
|
360
|
-
│ ├── hubspot.md # HubSpot connector pattern
|
|
361
|
-
│ └── postgres.md # Postgres/MySQL pattern
|
|
362
|
-
└── deploy/
|
|
363
|
-
├── Dockerfile # Container deployment
|
|
364
|
-
├── render.yaml # Render cron service
|
|
365
|
-
└── github-action.yml # GitHub Actions schedule
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### Governance (`skills/governance/`)
|
|
369
|
-
|
|
370
|
-
Manage guidelines as code — maintain a `governance/guidelines/` folder of `.md` files and sync them to the Personize API.
|
|
343
|
+
AI-assistant skills for Claude Code, Codex, and Cursor are available separately:
|
|
371
344
|
|
|
345
|
+
```bash
|
|
346
|
+
npx skills add personizeai/personize-skills --all
|
|
372
347
|
```
|
|
373
|
-
skills/governance/
|
|
374
|
-
├── CLAUDE.md # Main skill instructions
|
|
375
|
-
├── sync.ts # CLI sync script
|
|
376
|
-
└── github-action.yml # CI sync on push
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
### AI Content Pipelines (`skills/content-pipelines/`)
|
|
380
|
-
|
|
381
|
-
Build intelligent, memory-powered AI systems that follow a 10-step agentic loop: **Observe → Remember → Recall → Reason → Plan → Decide → Generate → Act → Update → Repeat**. Includes ready-to-run recipe scripts for product intelligence memorization, smart notifications, web page personalization, cold outreach, and more — plus channel delivery templates for SendGrid, Slack, Twilio, and generic webhooks.
|
|
382
|
-
|
|
383
|
-
```
|
|
384
|
-
skills/content-pipelines/
|
|
385
|
-
├── CLAUDE.md # Main skill instructions (10-step loop)
|
|
386
|
-
├── recipes/
|
|
387
|
-
│ ├── product-intelligence.ts # Memorize everything: usage, ML, searches, content, uploads, telemetry
|
|
388
|
-
│ ├── smart-notification.ts # Uniquely personalized alerts via smartDigest
|
|
389
|
-
│ ├── web-personalization.ts # AI generates UI variable values for personalized web pages
|
|
390
|
-
│ ├── cold-outreach-sequence.ts # 3-email cold outreach with sequence tracking
|
|
391
|
-
│ ├── meeting-prep-brief.ts # On-demand meeting prep brief generator
|
|
392
|
-
│ ├── product-usage-alert.ts # Usage monitoring + smart alerts
|
|
393
|
-
│ ├── health-check-message.ts # Customer health assessment + check-in
|
|
394
|
-
│ └── batch-pipeline.ts # Configurable generic batch pipeline
|
|
395
|
-
└── channels/
|
|
396
|
-
├── sendgrid.md # Email delivery (SendGrid, SES, Resend)
|
|
397
|
-
├── slack.md # Slack webhooks + Web API
|
|
398
|
-
├── twilio.md # SMS + WhatsApp via Twilio
|
|
399
|
-
└── webhook.md # Generic HTTP POST (in-app, CRM, Zapier)
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
### n8n Workflow Builder (`skills/n8n-workflows/`)
|
|
403
|
-
|
|
404
|
-
Generate importable n8n workflow JSON files that sync data between Personize and 400+ apps — no code required. Supports batch sync in (source → Personize), sync out (Personize → destination), webhook-triggered real-time ingestion, and per-record AI enrichment.
|
|
405
348
|
|
|
406
|
-
|
|
407
|
-
skills/n8n-workflows/
|
|
408
|
-
├── CLAUDE.md # Main skill instructions
|
|
409
|
-
└── templates/
|
|
410
|
-
├── hubspot-to-personize.json # HubSpot contacts → Personize
|
|
411
|
-
├── gsheets-to-personize.json # Google Sheets → Personize
|
|
412
|
-
├── webhook-to-personize.json # Webhook → Personize (real-time)
|
|
413
|
-
└── personize-to-slack.json # Personize → Slack digest
|
|
414
|
-
```
|
|
349
|
+
See [personizeai/personize-skills](https://github.com/personizeai/personize-skills) for the full catalog.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PersonizeConfig, ApiResponse, MeResponse, TestResponse, ListOptions, GuidelinesResponse, GuidelineSectionOptions, GuidelineUpdatePayload, GuidelineCreatePayload, GuidelineHistoryResponse, GuidelineHistoryOptions, CollectionsResponse, CollectionCreatePayload, CollectionUpdatePayload, CollectionHistoryOptions, CollectionHistoryResponse, SmartGuidelinesOptions, SmartGuidelinesResponse, PromptOptions, PromptResponse, AgentRunOptions, AgentResponse, MemorizeOptions, SmartRecallOptions, RecallOptions, SearchOptions, SearchResponse,
|
|
1
|
+
import { PersonizeConfig, ApiResponse, MeResponse, TestResponse, ListOptions, GuidelinesResponse, GuidelineSectionOptions, GuidelineUpdatePayload, GuidelineCreatePayload, GuidelineHistoryResponse, GuidelineHistoryOptions, CollectionsResponse, CollectionCreatePayload, CollectionUpdatePayload, CollectionHistoryOptions, CollectionHistoryResponse, SmartGuidelinesOptions, SmartGuidelinesResponse, PromptOptions, PromptResponse, AgentRunOptions, AgentResponse, MemorizeOptions, SmartRecallOptions, RecallOptions, SearchOptions, SearchResponse, BatchMemorizeOptions, SmartDigestOptions, SmartDigestResponse, EvaluateMemorizationOptions, EvaluateMemorizationResponse } from './types';
|
|
2
2
|
export declare class Personize {
|
|
3
3
|
private client;
|
|
4
4
|
private _organizationId?;
|
|
@@ -121,14 +121,6 @@ export declare class Personize {
|
|
|
121
121
|
* Returns matching record IDs with optional property values and memories.
|
|
122
122
|
*/
|
|
123
123
|
search: (data: SearchOptions) => Promise<ApiResponse<SearchResponse>>;
|
|
124
|
-
/**
|
|
125
|
-
* POST /api/v1/upsert — Structured upsert (no AI extraction)
|
|
126
|
-
*/
|
|
127
|
-
upsert: (data: UpsertOptions) => Promise<ApiResponse>;
|
|
128
|
-
/**
|
|
129
|
-
* POST /api/v1/upsert — Batch upsert (memories array format)
|
|
130
|
-
*/
|
|
131
|
-
upsertBatch: (data: UpsertBatchOptions) => Promise<ApiResponse>;
|
|
132
124
|
/**
|
|
133
125
|
* POST /api/v1/batch-memorize — Unified batch sync with per-property extractMemories flag.
|
|
134
126
|
* Properties with extractMemories: true go through AI extraction + vectors.
|
package/dist/client.js
CHANGED
|
@@ -227,28 +227,6 @@ class Personize {
|
|
|
227
227
|
const response = await this.client.post('/api/v1/search', data);
|
|
228
228
|
return response.data;
|
|
229
229
|
},
|
|
230
|
-
/**
|
|
231
|
-
* POST /api/v1/upsert — Structured upsert (no AI extraction)
|
|
232
|
-
*/
|
|
233
|
-
upsert: async (data) => {
|
|
234
|
-
const organizationId = await this.getOrganizationId();
|
|
235
|
-
const response = await this.client.post('/api/v1/upsert', {
|
|
236
|
-
...data,
|
|
237
|
-
orgId: organizationId,
|
|
238
|
-
});
|
|
239
|
-
return response.data;
|
|
240
|
-
},
|
|
241
|
-
/**
|
|
242
|
-
* POST /api/v1/upsert — Batch upsert (memories array format)
|
|
243
|
-
*/
|
|
244
|
-
upsertBatch: async (data) => {
|
|
245
|
-
const organizationId = await this.getOrganizationId();
|
|
246
|
-
const response = await this.client.post('/api/v1/upsert', {
|
|
247
|
-
...data,
|
|
248
|
-
orgId: organizationId,
|
|
249
|
-
});
|
|
250
|
-
return response.data;
|
|
251
|
-
},
|
|
252
230
|
/**
|
|
253
231
|
* POST /api/v1/batch-memorize — Unified batch sync with per-property extractMemories flag.
|
|
254
232
|
* Properties with extractMemories: true go through AI extraction + vectors.
|
package/dist/types.d.ts
CHANGED
|
@@ -393,6 +393,12 @@ export interface PromptOptions {
|
|
|
393
393
|
provider?: string;
|
|
394
394
|
context?: string;
|
|
395
395
|
sessionId?: string;
|
|
396
|
+
/**
|
|
397
|
+
* Multimodal attachments (images, PDFs, documents).
|
|
398
|
+
* Max 10 attachments, 20 MB per attachment, 50 MB total.
|
|
399
|
+
* In multi-step mode, attachments are sent with the first instruction only.
|
|
400
|
+
*/
|
|
401
|
+
attachments?: PromptAttachment[];
|
|
396
402
|
/**
|
|
397
403
|
* Evaluation configuration.
|
|
398
404
|
* - `true` — server-side auto-evaluation with default criteria
|
|
@@ -414,16 +420,6 @@ export interface PromptOptions {
|
|
|
414
420
|
};
|
|
415
421
|
/** Per-MCP tool selection override (allowlist or denylist per MCP) */
|
|
416
422
|
mcpTools?: McpToolSelection[];
|
|
417
|
-
/**
|
|
418
|
-
* Images or documents to send with the prompt (multimodal input).
|
|
419
|
-
*
|
|
420
|
-
* In multi-step mode (`instructions`), attachments are sent with the
|
|
421
|
-
* **first instruction** only — subsequent steps reference them via
|
|
422
|
-
* conversation history.
|
|
423
|
-
*
|
|
424
|
-
* Limits: max 10 attachments, 20 MB each, 50 MB total.
|
|
425
|
-
*/
|
|
426
|
-
attachments?: Attachment[];
|
|
427
423
|
}
|
|
428
424
|
/** Prompt response when outputs/evaluation are used. */
|
|
429
425
|
export interface PromptResponse {
|
|
@@ -602,6 +598,8 @@ export type RecallProOptions = SmartRecallOptions;
|
|
|
602
598
|
export interface RecallOptions {
|
|
603
599
|
/** Natural-language query. */
|
|
604
600
|
query: string;
|
|
601
|
+
/** Entity type (e.g. 'Contact', 'Company'). Required by the /recall endpoint. */
|
|
602
|
+
type: string;
|
|
605
603
|
/** CRM record ID for entity scoping. */
|
|
606
604
|
record_id?: string;
|
|
607
605
|
/** Filter results to a specific entity by email. */
|
|
@@ -611,40 +609,6 @@ export interface RecallOptions {
|
|
|
611
609
|
/** Additional filters. */
|
|
612
610
|
filters?: Record<string, unknown>;
|
|
613
611
|
}
|
|
614
|
-
export interface UpsertOptions {
|
|
615
|
-
/** Entity type (e.g. 'Contact', 'Company') */
|
|
616
|
-
type: string;
|
|
617
|
-
/** Properties to store: { propertyName: { value, collectionId?, collectionName? } } */
|
|
618
|
-
properties: Record<string, {
|
|
619
|
-
value: PropertyValue;
|
|
620
|
-
collectionId?: string;
|
|
621
|
-
collectionName?: string;
|
|
622
|
-
}>;
|
|
623
|
-
/** Match keys for dedup (e.g. { email: 'john@example.com' }) */
|
|
624
|
-
matchKeys?: {
|
|
625
|
-
email?: string;
|
|
626
|
-
websiteUrl?: string;
|
|
627
|
-
};
|
|
628
|
-
/** Source label (e.g. 'CRM Sync') */
|
|
629
|
-
source?: string;
|
|
630
|
-
}
|
|
631
|
-
export interface UpsertBatchOptions {
|
|
632
|
-
/** Entity type */
|
|
633
|
-
type: string;
|
|
634
|
-
/** Array of memory items to upsert */
|
|
635
|
-
memories: Array<{
|
|
636
|
-
memoryName: string;
|
|
637
|
-
result: PropertyValue | Record<string, unknown>;
|
|
638
|
-
collection?: string;
|
|
639
|
-
collectionId?: string;
|
|
640
|
-
}>;
|
|
641
|
-
/** Contact email for record matching */
|
|
642
|
-
email?: string;
|
|
643
|
-
/** Company website for record matching */
|
|
644
|
-
websiteUrl?: string;
|
|
645
|
-
/** Source label */
|
|
646
|
-
source?: string;
|
|
647
|
-
}
|
|
648
612
|
export interface BatchMemorizePropertyMapping {
|
|
649
613
|
/** Source field name in the row data */
|
|
650
614
|
sourceField: string;
|
|
@@ -652,7 +616,7 @@ export interface BatchMemorizePropertyMapping {
|
|
|
652
616
|
collectionId: string;
|
|
653
617
|
/** Target collection name */
|
|
654
618
|
collectionName: string;
|
|
655
|
-
/**
|
|
619
|
+
/** AI extraction + vector embeddings for this property. Default: false. Set to true for rich text fields (notes, transcripts, descriptions) that benefit from AI extraction and semantic search. */
|
|
656
620
|
extractMemories?: boolean;
|
|
657
621
|
}
|
|
658
622
|
export interface BatchMemorizeMapping {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@personize/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Official Personize SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/
|
|
21
|
+
"url": "https://github.com/personizeai/personize-sdk.git"
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://personize.ai",
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/
|
|
25
|
+
"url": "https://github.com/personizeai/personize-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"personize",
|