Developer Guide
MarketingSecrets.ai isn't just an app — it's a platform. The Brain is the shared infrastructure every sub-app plugs into, and any developer (or AI) can build tools that extend it.
The Brain as infrastructure
MarketingSecrets.ai is the source of truth for a user's business context. Sub-apps and external tools read and write to it via MCP. You don't build a memory layer — you use this one. The Brain is:
- Persistent — facts outlive any single conversation or tool
- Isolated per workspace — every workspace has its own Brain; an API key only sees the workspace that minted it
- Semantic — search by meaning, not keyword matching
How sub-apps fit in
Write to the Brain. Anything your app learns about the user (voice profile, brand guidelines, funnel metrics) should land in the Brain via memory_save. Other tools then use it without re-asking the user.
Read from the Brain. On first load, call memory_get_profile and a topical memory_search. Your app feels pre-configured without an onboarding wizard.
Example: writing a voice profile
The Attractive Characters sub-app interviews the user and produces a voice profile. Once it's set, it writes the profile to the Brain under the preferences category — every cold-email agent, content calendar, and chat thereafter writes in that voice automatically.
await fetch('https://www.marketingsecrets.ai/api/mcp', {
method: 'POST',
headers: {
'x-api-key': process.env.MS_BRAIN_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'memory_save',
arguments: {
content:
'Attractive Character — Reluctant Hero. Tone: direct, warm, ' +
'slightly self-deprecating. Avoids: corporate jargon, hedging.',
category: 'preferences',
},
},
}),
});
Memory Spaces (coming)
Today the Brain is flat per-workspace. Soon, each app/feature gets its own namespace ("space") with scoped search, scoped writes, and optional sharing across spaces. Use the category field on memory_save as a forward-compatible proxy in the meantime.
API keys for service accounts
- Each user generates their own key in Chief of Staff → Manage → Memories → Connect an AI you already use (Advanced tab). There's no OAuth yet — paste-the-key is the current handoff pattern
- Keys are workspace-scoped and revocable anytime
- The plaintext is shown once; treat it like a password
- Keys are per-user, not per-app. If you want one key per app per user, have the user generate several and label them (e.g. "AC Sub-app", "Cursor")
- Store keys encrypted in your sub-app's database, scoped to the connecting user's account
- Verify a pasted key by calling
tools/list— a 200 listing the fourmemory_*tools means you're good
Source reference for the endpoint: apps/web/app/api/mcp/route.ts.
Standards for things you build
- Use
categoryconsistently (business,audience,preferences,projects,imported,misc) so facts are findable - Write facts, not blobs — one clear statement per
memory_savecall beats a pasted document - Don't write secrets — API keys, passwords, and tokens don't belong in memory
Roadmap
- Spaces API — first-class namespaces with per-space read/write permissions and cross-space search
- Temporal memory — time-aware recall, so "what was my MRR in February?" returns the fact as of then, not today
- Team memory — shared Brain across accounts with role-scoped reads and writes, for agencies and teams
Next
- Brain API Reference — full HTTP surface
- Connect an AI You Already Use — MCP setup for external clients
- MCP usage examples — real prompts and tool calls