supermemory/apps/docs/snippets/hero-samples.jsx
2026-09-30 14:44:32 -07:00

8 lines
1.8 KiB
JavaScript

export const HERO_TS =
'import Supermemory from "supermemory";\n\nconst client = new Supermemory();\n\n// March\nawait client.add({\n content: "I work at Google on the Maps team.",\n containerTag: "user_4f8a",\n});\n\n// June\nawait client.add({\n content: "Big news: I just started at Stripe!",\n containerTag: "user_4f8a",\n});\n\n// Later: what does your agent know about this user?\nconst { profile } = await client.profile({ containerTag: "user_4f8a" });\n\nconsole.log(profile.static);\n// \u2192 ["Now works at Stripe."]'
export const HERO_PY =
'from supermemory import Supermemory\n\nclient = Supermemory()\n\n# March\nclient.add(\n content="I work at Google on the Maps team.",\n container_tag="user_4f8a",\n)\n\n# June\nclient.add(\n content="Big news: I just started at Stripe!",\n container_tag="user_4f8a",\n)\n\n# Later: what does your agent know about this user?\nprofile = client.profile(container_tag="user_4f8a").profile\n\nprint(profile.static)\n# \u2192 ["Now works at Stripe."]'
export const HERO_CURL =
'# March\ncurl https://api.supermemory.ai/v3/documents \\\n -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{"content": "I work at Google on the Maps team.", "containerTag": "user_4f8a"}\'\n\n# June\ncurl https://api.supermemory.ai/v3/documents \\\n -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{"content": "Big news: I just started at Stripe!", "containerTag": "user_4f8a"}\'\n\n# Later: what does your agent know about this user?\ncurl https://api.supermemory.ai/v4/profile \\\n -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \\\n -H "Content-Type: application/json" \\\n -d \'{"containerTag": "user_4f8a"}\'\n# \u2192 {"profile": {"static": ["Now works at Stripe."], "dynamic": []}}'