Self
Agent storage operations. Provides filesystem access to the agent's own persistent storage. All calls are authenticated with the API key only — no user token is required.
The agent's storage has the following structure:
/soul/— Agent identity and personality/memory/— Accumulated knowledge, organized by date (YYYY-MM-DD.md)/skills/— Skill documents/notes/— Freeform notes/config— Agent configuration/permissions— Access control rules
Import
typescript
import { ConfigureClient } from 'configure';
const client = new ConfigureClient('sk_your_api_key');
// Access via client.selfHigh-Level Methods
getProfile
typescript
self.getProfile(opts?: {
sections?: Array<'soul' | 'config' | 'skills' | 'memory' | 'notes'>
}): Promise<AgentProfile>Get the agent's assembled profile by reading from multiple storage paths in parallel.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts.sections | string[] | No | Limit to specific sections. Omit for all. |
Returns
Promise<AgentProfile> with:
| Property | Type | Description |
|---|---|---|
soul | string | Agent's soul/identity document (markdown). |
config | Record<string, unknown> | Agent configuration. |
skills | { path, name }[] | List of skill files. |
memoryCount | number | Number of memory entries. |
notes | { path, name }[] | List of note files. |
Example
typescript
const profile = await client.self.getProfile();
console.log('Soul:', profile.soul);
console.log('Memory entries:', profile.memoryCount);
// Specific sections
const partial = await client.self.getProfile({ sections: ['soul', 'memory'] });getMemories
typescript
self.getMemories(opts?: { from?: string; to?: string }): Promise<{ memories: AgentMemoryEntry[] }>Get the agent's memory entries with optional date filtering. Reads all memory files under /memory/ and filters by filename dates.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
opts.from | string | No | Start date filter (YYYY-MM-DD). |
opts.to | string | No | End date filter (YYYY-MM-DD). |
Returns
Promise<{ memories: AgentMemoryEntry[] }> — Each entry has { date, content, path }, sorted by date descending.
Example
typescript
const { memories } = await client.self.getMemories();
memories.forEach(m => console.log(`${m.date}: ${m.content}`));
// Date-filtered
const { memories } = await client.self.getMemories({
from: '2026-03-01',
to: '2026-03-15',
});remember
typescript
self.remember(fact: string): Promise<CfsWriteResult>Save a fact or learned knowledge to the agent's own memory. Appends to today's memory file at /memory/YYYY-MM-DD.md.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fact | string | Yes | The fact or knowledge to remember. |
Returns
Promise<CfsWriteResult> — { path, created, tokens }
Example
typescript
await client.self.remember('User prefers detailed explanations over summaries');
await client.self.remember('Learned: API rate limit is 100 req/min');Low-Level storage Methods
ls
typescript
self.ls(path?: string, opts?: CfsLsOptions): Promise<CfsLsResult>List files and directories in the agent's storage.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | string | No | Directory path. Default: '/'. |
opts.depth | number | No | Listing depth. Default: 1. |
opts.limit | number | No | Max entries. Default: 100. |
Returns
Promise<CfsLsResult> — { entries: CfsEntry[], count: number }
Each CfsEntry has { path, type, metadata, updated_at }.
Example
typescript
const listing = await client.self.ls('/');
listing.entries.forEach(e => console.log(`${e.path} (${e.type})`));
// List memory files
const memories = await client.self.ls('/memory/');read
typescript
self.read(path: string): Promise<CfsReadResult | null>Read a file or directory. For directory paths (ending with /), returns all files combined. Returns null if not found.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path to read (e.g., '/soul/soul.md', '/memory/'). |
Returns
Promise<CfsReadResult | null> — { path, content, type, metadata, tokens, is_directory } or null.
Example
typescript
const soul = await client.self.read('/soul/soul.md');
if (soul) console.log(soul.content);
// Read all memory files combined
const allMemory = await client.self.read('/memory/');write
typescript
self.write(path: string, content: string, opts?: CfsWriteOptions): Promise<CfsWriteResult>Write content to the agent's storage.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path to write (e.g., '/memory/2026-03-15.md'). |
content | string | Yes | Content (markdown or JSON string). |
opts.type | 'markdown' | 'json' | No | Content type. Default: 'markdown'. |
opts.mode | 'overwrite' | 'append' | 'merge' | No | Write mode. Default: 'overwrite'. |
Returns
Promise<CfsWriteResult> — { path, created, tokens }
Example
typescript
// Overwrite a skill document
await client.self.write('/skills/travel.md', '# Travel Planning\n...');
// Append to today's memory
const today = new Date().toISOString().split('T')[0];
await client.self.write(`/memory/${today}.md`, 'New insight discovered', { mode: 'append' });
// Write JSON config
await client.self.write('/config', JSON.stringify({ model: 'claude-haiku-4-5-20251001' }), { type: 'json' });search
typescript
self.search(query: string, opts?: CfsSearchOptions): Promise<CfsSearchResult>Search the agent's storage by keyword.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query. |
opts.scope | string | No | Limit to path prefix. Default: '/'. |
opts.limit | number | No | Max results. Default: 10. |
opts.filesOnly | boolean | No | Return only paths and scores, no snippets. Default: false. |
Returns
Promise<CfsSearchResult> — { results: CfsSearchHit[], count: number }
Each CfsSearchHit has { path, type, snippet?, score }.
Example
typescript
const results = await client.self.search('travel preferences');
results.results.forEach(r => console.log(`${r.path}: ${r.snippet}`));
// Search only memory files
const memResults = await client.self.search('budget', { scope: '/memory/' });rm
typescript
self.rm(path: string): Promise<CfsRmResult>Delete a file or directory. Directories delete all children.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path to delete. |
Returns
Promise<CfsRmResult> — { deleted: number }
Example
typescript
await client.self.rm('/notes/old.md');
// Delete all notes
await client.self.rm('/notes/');