{"uid":"cap_oRnX0hftq_uLHi4beVLX8","slug":"agent-memory-api-store-memory-7b9c4032","name":"Agent Memory API – Store Memory","description":"Store a persistent key-value memory for an AI agent (namespace-isolated, optional TTL and metadata). Returns the stored memory record as JSON.","url":"https://agent-memory-api-production-f2c4.up.railway.app/v1/memories","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"key":{"type":"string","description":"Memory identifier"},"value":{"description":"Any JSON value or string"},"metadata":{"type":"object","description":"Arbitrary metadata for filtering"},"namespace":{"type":"string","description":"Isolation scope (e.g. agent ID)"},"ttl_seconds":{"type":"integer","description":"Auto-expire after N seconds"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QkBge0DJAxDBnH0TZQKLn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Persists a key-value memory record for an AI agent with optional namespace isolation, TTL, and metadata.","exampleAgentPrompt":"Save a memory for agent 'assistant-42' with key 'user_preference_theme' and value 'dark_mode' in the 'assistant-42' namespace, and have it expire in 86400 seconds.","exampleUseCases":[{"title":"Persist user preferences across sessions","prompt":"Store a memory for agent 'concierge-7' with key 'preferred_language' and value 'French' in the 'concierge-7' namespace so it remembers the user's preference next time."},{"title":"Cache API result with auto-expiry","prompt":"Save the key 'weather_cache_nyc' with value '{\"temp\":72,\"condition\":\"sunny\"}' under namespace 'weather-agent', and make it expire after 3600 seconds so it refreshes hourly."},{"title":"Tag memory with metadata for filtering","prompt":"Write a memory for agent 'sales-bot-1' with key 'lead_score_acme' and value '87', add metadata like '{\"source\":\"crm\",\"priority\":\"high\"}' so I can filter it later, in namespace 'sales-bot-1'."}],"resultDescription":"Returns the stored memory record as a JSON object, including the key, value, namespace, metadata, TTL, and any system-generated timestamps or identifiers confirming the write.","failureModes":["Missing required 'key' or 'value' fields returns a 400 validation error","Invalid JSON in the value field may cause a parse error","Namespace conflicts or permission issues may prevent writes","TTL value of 0 or negative integer may be rejected","Payment failure (x402) blocks the request before processing","Network timeouts to the Railway-hosted service cause request failures"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to persist state, preferences, or context between sessions with namespace isolation per agent instance. It is ideal when you need optional automatic expiration (TTL) and metadata tagging for future filtering. Prefer it over generic databases when you want a lightweight, agent-native key-value store with per-call micropayment pricing and no setup overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:21.275Z","isFirstParty":false}