Skip to content

Profile

User profile operations: read identity and preferences, query memories, save facts, ingest conversations, and access the user's storage.

Import

typescript
import { ConfigureClient } from 'configure';
const client = new ConfigureClient('sk_your_api_key');
// Access via client.profile

Methods

get

typescript
profile.get(
  authToken?: string,
  userId?: string,
  options?: { path?: string; sections?: Array<'identity' | 'preferences' | 'integrations' | 'agents' | 'summary'> }
): Promise<UserProfile>

Get the user's profile. Returns identity, preferences, integrations, agents, and summary by default. Use sections to limit the response, or path to read a specific storage path.

Parameters

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
options.pathstringNostorage path to read directly (e.g., 'identity').
options.sectionsstring[]NoLimit to specific sections: identity, preferences, integrations, agents, summary.

Returns

Promise<UserProfile> — The user's profile data.

Example

typescript
// Full profile
const profile = await client.profile.get(token, userId);

// Specific sections only
const partial = await client.profile.get(token, userId, {
  sections: ['identity', 'preferences'],
});

INFO

getProfile() has been removed. Use get() instead.


format

typescript
profile.format(options?: { includeTools?: boolean }): string

Convert a profile to a prompt-ready string. Pure function — no network calls. By default, the output includes identity, preferences, connected tool names, summary, and agent memories. Tool data (Gmail insights, calendar events, Drive files, Notion pages) is excluded by default to keep the context lean.

Pass { includeTools: true } to append tool data to the output. This is useful when your agent needs to reason about the user's emails, schedule, or files inline — but adds significant token overhead.

Parameters

NameTypeRequiredDescription
options.includeToolsbooleanNoInclude synced tool data (Gmail, Calendar, Drive, Notion) in the formatted string. Default: false.

Returns

string — A prompt-ready context string.

Example

typescript
const profile = await client.profile.get(token, userId);

// Default — identity, preferences, memories (lean)
const context = profile.format();

// With tool data — adds Gmail insights, calendar events, etc.
const rich = profile.format({ includeTools: true });

getMemories

typescript
profile.getMemories(
  authToken?: string,
  userId?: string,
  options?: { agent?: string; agents?: string[]; from?: string; to?: string }
): Promise<{ memories: { agent: string; date: string; content: string; source?: string }[] }>

Query memories across agents with optional filters.

Parameters

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
options.agentstringNoFilter to a specific agent's memories. Use 'self' for the calling agent.
options.agentsstring[]NoFilter to multiple agents' memories.
options.fromstringNoStart date filter (YYYY-MM-DD).
options.tostringNoEnd date filter (YYYY-MM-DD).

Returns

Promise<{ memories: Array<{ agent, date, content, source? }> }> — Filtered memory entries sorted by date.

Example

typescript
// All memories
const { memories } = await client.profile.getMemories(token, userId);

// This agent's memories only
const { memories } = await client.profile.getMemories(token, userId, { agent: 'self' });

// Date-filtered
const { memories } = await client.profile.getMemories(token, userId, {
  agent: 'travelbot',
  from: '2026-03-01',
  to: '2026-03-08',
});

remember

typescript
profile.remember(
  authToken?: string,
  userId?: string,
  fact: string
): Promise<RememberResponse>

Save a specific fact or preference to the user's memory.

Parameters

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
factstringYesThe fact or preference to remember.

Returns

Promise<RememberResponse>{ saved: boolean, app: string, fact: string }

Example

typescript
await client.profile.remember(token, userId, 'User prefers window seats on flights');
await client.profile.remember(token, userId, 'Allergic to shellfish');

ingest

typescript
// Conversation mode
profile.ingest(
  authToken?: string,
  userId?: string,
  messages: ConversationMessage[],
  options?: IngestOptions
): Promise<IngestResponse>

// Text mode
profile.ingest(
  authToken?: string,
  userId?: string,
  options: IngestOptions & { text: string }
): Promise<IngestResponse>

// Batch mode
profile.ingest(
  users: IngestUserEntry[],
  options?: IngestBatchOptions
): Promise<IngestBatchResponse>

Extract and save memories from conversations, freeform text, or in batch across multiple users. Fire-and-forget by default; pass sync: true to wait for completion.

Parameters (Conversation mode)

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
messagesConversationMessage[]YesArray of { role, content } messages.
options.memoryCriteriastringNoWhat to extract (e.g., "travel preferences").
options.syncbooleanNoBlock until extraction completes. Default: false.

Parameters (Text mode)

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
options.textstringYesFreeform text to extract memories from.
options.memoryCriteriastringNoWhat to extract.
options.syncbooleanNoBlock until extraction completes. Default: false.

Parameters (Batch mode)

NameTypeRequiredDescription
usersIngestUserEntry[]YesArray of user entries with content. No auth token needed — API key auth only.
options.memoryCriteriastringNoWhat to extract.
options.syncbooleanNoBlock until all extractions complete. Default: false.

Returns

  • Conversation/Text: Promise<IngestResponse>{ status: 'processing' | 'completed' }
  • Batch: Promise<IngestBatchResponse>{ status, totalUsers, totalConversations, totalFactsWritten, users }

Example

typescript
// Conversation mode
await client.profile.ingest(token, userId, [
  { role: 'user', content: 'I prefer window seats on flights' },
  { role: 'assistant', content: 'Noted! I will remember that.' },
], { sync: true });

// Text mode
await client.profile.ingest(token, userId, {
  text: 'I live in SF and work at Stripe...',
  sync: true,
});

// Batch mode (API key auth only, no user token)
await client.profile.ingest([
  { userId: 'user@example.com', text: 'I love sushi and live in Tokyo' },
  { userId: 'other@example.com', messages: [
    { role: 'user', content: 'My budget is $5000' },
  ]},
], { sync: true });

Moved to tools module

profile.sync() has been moved to tools.syncAll(). See the Tools reference for details.


generateDocuments

typescript
profile.generateDocuments(
  authToken?: string,
  userId?: string,
  documents?: ('user.md' | 'soul.md' | 'preferences.md' | 'context.md' | 'all')[]
): Promise<GenerateDocumentsResponse>

Regenerate the user's AI identity documents using the latest profile data. Has a 1-hour cooldown and returns cached documents if generated recently.

Parameters

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
documentsstring[]NoSpecific documents to generate. Omit or use 'all' for the full suite.

Returns

Promise<GenerateDocumentsResponse>{ documents: {...}, cached: boolean }

Example

typescript
const result = await client.profile.generateDocuments(token, userId);
if (!result.cached) {
  console.log('Freshly generated!');
}

storage Methods

These methods provide direct filesystem access to the user's profile storage via the profile module.

ls

typescript
profile.ls(authToken?: string, userId?: string, path?: string, opts?: CfsLsOptions): Promise<ProfileManifest | CfsLsResult>

List files and directories. At root path ('/'), returns a ProfileManifest with shape and counts. At sub-paths, returns raw storage entries.

Parameters

NameTypeRequiredDescription
authTokenstringNoFrom <configure-auth> event. Omit if using server-side users.
userIdstringNoFalls back to client-level userId.
pathstringNoDirectory path. Default: '/'.
opts.depthnumberNoListing depth. Default: 1.
opts.limitnumberNoMax entries. Default: 100.

read

typescript
profile.read(authToken?: string, userId?: string, path: string): Promise<CfsReadResult | null>

Read a file or directory from the user's storage. Returns null if not found.


write

typescript
profile.write(
  authToken?: string,
  userId?: string,
  path: string,
  content: string,
  opts?: CfsWriteOptions
): Promise<CfsWriteResult>

Write content to a path. Agents can only write under /agents/{their_name}/.

NameTypeRequiredDescription
opts.type'markdown' | 'json'NoContent type. Default: 'markdown'.
opts.mode'overwrite' | 'append' | 'merge'NoWrite mode. Default: 'overwrite'.

typescript
profile.search(
  authToken?: string,
  userId?: string,
  query: string,
  opts?: CfsSearchOptions
): Promise<CfsSearchResult>

Full-text search the user's storage.

NameTypeRequiredDescription
opts.scopestringNoLimit to path prefix. Default: '/'.
opts.limitnumberNoMax results. Default: 10.

rm

typescript
profile.rm(authToken?: string, userId?: string, path: string): Promise<CfsRmResult>

Delete a file or directory. Agents can only delete under /agents/{their_name}/. Directories delete all children.

Identity and memory infrastructure for AI agents