Skip to content

SDK Converters

PAM SDKs convert provider-specific exports into the portable PAM format. Each SDK targets a single language and provides both a CLI and a programmatic API.

Python

Official SDK: CLI and library for converting, validating, and building PAM files

Available
TypeScript

Node.js package for PAM conversion and validation

Coming soon
Go

Native Go module for PAM processing

Planned
Rust

PAM reader/writer for Rust

Planned
Java

JVM library for PAM integration

Planned
C#

.NET library for PAM support

Planned

The official Python SDK is the first reference implementation. It supports converting, validating, inspecting, and building PAM documents.

Terminal window
pip install portable-ai-memory # core SDK (models, I/O, validation, converters)
pip install 'portable-ai-memory[cli]' # + CLI tool (pam command)
Terminal window
# Convert a provider export to a PAM bundle (auto-detects provider)
pam convert ~/chatgpt-export/ -o ./pam-bundle/ --owner-id user-123
# Force a specific provider
pam convert export.json -o ./pam-bundle/ --provider claude
# Validate the result
pam validate ./pam-bundle/
# Inspect the output
pam inspect ./pam-bundle/memory-store.json

The SDK auto-detects the provider format and converts conversations, memories, and metadata into PAM documents.

import json
from pathlib import Path
from portable_ai_memory.converters import detect_provider
from portable_ai_memory import ProviderNotDetectedError
try:
converter = detect_provider("conversations.json")
data = json.loads(Path("conversations.json").read_text())
conversations = converter.convert_conversations(
data, owner_id="user-123",
)
except ProviderNotDetectedError as e:
print(f"Unknown format: {e}")
ProviderSource format
OpenAI (ChatGPT)conversations.json
Anthropic (Claude)conversations.json + memories.json
Google (Gemini)Takeout JSON or HTML
xAI (Grok)prod-grok-backend.json
Microsoft (Copilot)CSV exports

To list registered converters:

from portable_ai_memory.converters import list_converters
print(list_converters()) # ['chatgpt', 'claude', 'gemini', 'grok', 'copilot']

See the Provider pages for details on each provider’s export format and field mappings.

MemoryObject.create() auto-fills content_hash, temporal, and provenance metadata.

from portable_ai_memory import MemoryStore, MemoryObject, Owner, save
store = MemoryStore(
schema_version="1.0",
owner=Owner(id="user-123"),
memories=[
MemoryObject.create(
id="mem-001",
type="preference",
content="User prefers dark mode.",
platform="my-app",
)
],
)
save(store, "memory-store.json")
# Convenience lookups
mem = store.get_memory_by_id("mem-001")
prefs = store.get_memories_by_type("preference")
  • Auto-detects the provider’s export format
  • Maps fields to PAM schema
  • Computes content hashes per spec §6 normalization
  • Outputs valid, schema-compliant PAM documents
  • Generates companion conversation files with full message history
  • Copies attachments when present in the source export