polarity_export
Export your full personal knowledge graph as JSON for backup or migration.
Instructions
Export the user's full personal knowledge graph (nodes + edges + counts) as JSON in polarity/v1 format. Use this when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file. Returns the full graph; can be large.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:21-27 (registration)Registration of the polarity_export tool in the TOOLS array, defining its name, description, input schema (empty object), and handler that delegates to client.export()
{ name: "polarity_export", description: "Export the user's full personal knowledge graph (nodes + edges + counts) as JSON in polarity/v1 format. Use this when the user asks for a snapshot of their exocortex, wants their data, or asks to download their .polarity file. Returns the full graph; can be large.", inputSchema: z.object({}).strict(), handler: async (_input, client) => client.export(), }, - src/client/cosmos.ts:63-69 (handler)The export() method on CosmosClient that sends a POST request to /api/polarity/export with the polarity_user_id, returning an ExportResponse
export() { return this.request<ExportResponse>({ method: "POST", path: "/api/polarity/export", body: { polarity_user_id: this.config.polarityUserId }, }); } - src/client/cosmos.ts:194-202 (schema)ExportResponse type defining the structure returned by the polarity_export endpoint including format, exported_at, polarity_user_id, cosmos_user_id, nodes, edges, and counts
export interface ExportResponse { format: string; exported_at: string; polarity_user_id: string; cosmos_user_id: number; nodes: PolarityNode[]; edges: PolarityEdge[]; counts: { nodes: number; edges: number }; } - src/client/cosmos.ts:165-179 (schema)PolarityNode interface - the shape of each node in the exported knowledge graph
export interface PolarityNode { id: number; type: string; label: string; content: string | null; source: string | null; confidence: number | null; weight: number | null; last_observed: string | null; reinforcement_count: number | null; emotional_score?: number | null; functional_network?: string | null; created_at?: string; updated_at?: string; } - src/client/cosmos.ts:181-192 (schema)PolarityEdge interface - the shape of each edge in the exported knowledge graph
export interface PolarityEdge { id: number; from_id: number; to_id: number; label: string; strength: number; source: string | null; confidence: number | null; status: string; created_at?: string; updated_at?: string; }