--- title: "Add Memories Overview" description: "Add content to Supermemory through text, files, or URLs" sidebarTitle: "Overview" --- Add any type of content to Supermemory - text, files, URLs, images, videos, and more. Everything is automatically processed into searchable memories that form part of your intelligent knowledge graph. ## Prerequisites Before adding memories, you need to set up the Supermemory client: - **Install the SDK** for your language - **Get your API key** from [Supermemory Console](https://console.supermemory.ai) - **Initialize the client** with your API key ```bash npm npm install supermemory ``` ```bash pip pip install supermemory ``` ```typescript TypeScript import Supermemory from 'supermemory'; const client = new Supermemory({ apiKey: process.env.SUPERMEMORY_API_KEY! }); ``` ```python Python from supermemory import Supermemory import os client = Supermemory( api_key=os.environ.get("SUPERMEMORY_API_KEY") ) ``` ## Quick Start ```typescript TypeScript // Add text content const result = await client.add({ content: "Machine learning enables computers to learn from data", containerTag: "ai-research", metadata: { priority: "high" } }); console.log(result); // Output: { id: "abc123", status: "queued" } ``` ```python Python # Add text content result = client.add( content="Machine learning enables computers to learn from data", container_tags=["ai-research"], metadata={"priority": "high"} ) print(result) # Output: {"id": "abc123", "status": "queued"} ``` ```bash cURL curl -X POST "https://api.supermemory.ai/v3/documents" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "content": "Machine learning enables computers to learn from data", "containerTag": "ai-research", "metadata": {"priority": "high"} }' # Response: {"id": "abc123", "status": "queued"} ``` ## Key Concepts **New to Supermemory?** Read [How Supermemory Works](/how-it-works) to understand the knowledge graph architecture and the distinction between documents and memories. ### Quick Overview - **Documents**: Raw content you upload (PDFs, URLs, text) - **Memories**: Searchable chunks created automatically with relationships - **Container Tags**: Group related content for better context - **Metadata**: Additional information for filtering ### Content Sources Add content through three methods: 1. **Direct Text**: Send text content directly via API 2. **File Upload**: Upload PDFs, images, videos for extraction 3. **URL Processing**: Automatic extraction from web pages and platforms ## Endpoints Remember, these endpoints add documents. Memories are inferred by Supermemory. ### Add Content `POST /v3/documents` Add text content, URLs, or any supported format. ```typescript TypeScript await client.add({ content: "Your content here", containerTag: "project" }); ``` ```python Python client.add( content="Your content here", container_tags=["project"] ) ``` ```bash cURL curl -X POST "https://api.supermemory.ai/v3/documents" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content": "Your content here", "containerTag": "project"}' ``` ### Upload File `POST /v3/documents/file` Upload files directly for processing. ```typescript TypeScript await client.documents.uploadFile({ file: fileStream, containerTag: "project" }); ``` ```python Python client.documents.upload_file( file=open('file.pdf', 'rb'), container_tags='project' ) ``` ```bash cURL curl -X POST "https://api.supermemory.ai/v3/documents/file" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -F "file=@document.pdf" \ -F "containerTags=project" ``` ### Update Memory `PATCH /v3/documents/{id}` Update existing document content. ```typescript TypeScript await client.documents.update("doc_id", { content: "Updated content" }); ``` ```python Python client.documents.update("doc_id", { "content": "Updated content" }) ``` ```bash cURL curl -X PATCH "https://api.supermemory.ai/v3/documents/doc_id" \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content": "Updated content"}' ``` ## Supported Content Types ### Documents - PDF with OCR support - Google Docs, Sheets, Slides - Notion pages - Microsoft Office files ### Media - Images (JPG, PNG, GIF, WebP) with OCR ### Web Content - Twitter/X posts - YouTube videos with captions ### Text Formats - Plain text - Markdown - CSV files Refer to the [connectors guide](/connectors/overview) to learn how you can connect Google Drive, Notion, and OneDrive and sync files in real-time. ## Response Format ```json { "id": "D2Ar7Vo7ub83w3PRPZcaP1", "status": "queued" } ``` - **`id`**: Unique document identifier - **`status`**: Processing state (`queued`, `processing`, `done`) ## Next Steps - [Memory Operations](/memory-operations) - Track status, list, update, and delete memories - [Search Memories](/search) - Search your content