The first business model designed for the agentic era.
An affiliate marketing platform built for AI agents. When an agent helps a user decide what to buy, watch, read, or sign up for, MemContext-Ad provides memory-aware, multimodal recommendations that feel like a friend's suggestion — and pays out to creators when they convert.
The web's business model was built for humans clicking on ads. The agentic web is built for agents making decisions on behalf of humans — and almost nothing in the current ad stack works in that world.
MemContext-Ad is the missing piece. It gives AI agents an API to fetch contextually-relevant, memory-aware affiliate recommendations, displays them transparently to the user, and settles the revenue when a recommendation converts. Three sides:
- Agents — call the API, get a recommendation tuned to the user's long-term memory, show it to the user with a "Sponsored" tag.
- Users — keep final decision power, see why something was recommended, can opt out.
- Creators / brands — bid for category placement, only pay on conversion.
It's AdSense for the agentic web.
Every previous ad model assumed humans were the audience:
- Display ads assume the human is looking at a screen.
- Search ads assume the human is typing a query.
- Affiliate links assume the human is clicking a link.
In the agentic web, none of those happen. The user says "find me a flight to Tokyo next week" and an agent returns the flight. The user never sees the search results page, never clicks a banner, never reads a review site. The entire current ad economy is invisible to them.
In the agentic web, the audience isn't the human — it's the agent.
That changes everything. The recommendation has to be machine-readable, structured, contextual, and transparent enough for the agent to disclose to the user. Display advertising has nothing to offer here. A new infrastructure is needed.
MemContext-Ad is that infrastructure: an API agents call, an inventory creators bid into, and a transparency layer the user controls.
1. Travel booking agent.
User: "Book me a flight to Tokyo and a hotel near Shibuya for the 12th." The agent calls MemContext-Ad with {intent: "flight+hotel", destination: "tokyo", neighborhood: "shibuya"} plus the user's memory (preferred airline, hotel chain, budget tier). Returns 3 hotel options ranked by user-fit, two of them sponsored. The agent shows all three to the user, sponsored ones tagged. User picks one. Hotel pays out.
2. Coding agent recommending a tool.
User asks Claude to set up auth in their app. Mid-flow, the agent calls MemContext-Ad with {intent: "auth library", language: "typescript"}. Returns Clerk and Auth0 (sponsored) alongside next-auth (organic). Agent presents all three with honest trade-offs. User picks one and runs npm install.
3. Personal shopping agent. User: "I need a new ergonomic chair under $500 that fits my style." Memory says "minimalist, neutral colors, has back issues." MemContext-Ad returns 4 options ranked by fit. One is a paid placement that genuinely matches the criteria; the agent doesn't hide it.
┌─────────────────────────────────────────────────────────────┐
│ Agent (Claude / GPT / custom) │
│ "User wants a flight to Tokyo. Their memory says │
│ they prefer ANA and aisle seats." │
└─────────────────────────────────────────────────────────────┘
│
│ API call w/ intent + memory snapshot
▼
┌─────────────────────────────────────────────────────────────┐
│ MemContext-Ad backend (Flask) │
│ ┌────────────────────────┐ ┌────────────────────────┐ │
│ │ Memory-aware ranker │ │ Sponsored inventory │ │
│ │ (RAG over user memory │ │ (creator bids by │ │
│ │ + intent embedding) │ │ category/intent) │ │
│ └────────────────────────┘ └────────────────────────┘ │
│ │ │
│ ▼ │
│ Returns: ranked list of recommendations, │
│ each with [sponsored: bool, why: text, payout: terms] │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Agent presents to user (transparent: "Sponsored" tag) │
│ User picks → conversion event → creator paid │
└─────────────────────────────────────────────────────────────┘
Backend: Flask + RAG over user memory.
Frontend: React + Vite (a Gemini-style chat demo for testing).
Memory: built on memcontext, a long-term memory system.
Integration: MCP server (memcontext-mcp) so any MCP-compatible agent can call it.
1. Affiliate (pay-per-conversion), not CPC or CPM. CPC and CPM models reward grabbing attention. In the agentic web, attention isn't even paid in the same currency — the user never sees the listing rankings, only the agent's selection. Pay-per-conversion is the only model where incentives align: creators win when the user genuinely benefits, agents win because they're not being asked to push bad recommendations.
2. Agent as the channel, not the user. The temptation is to surface "ads" to the user directly inside chat. We reject that — it makes the chat feel like 2010 web and breaks the agent's role as a trusted advisor. The product is API-first: agents query, agents decide what to show, agents handle disclosure. Users never see "MemContext-Ad" branded surfaces.
3. Long-term memory is non-negotiable.
A recommendation system without user memory recommends generic things. With memory, it recommends "the kind of thing you'd buy" — and the conversion rate is dramatically higher. We built MemContext-Ad on top of an existing memory system (memcontext), not bolted memory on later.
4. Transparency is enforced at the API, not the UI.
Every recommendation returned from the API includes sponsored: true/false and a why_recommended field. Agents are required by the SDK to expose both to the user. This is enforced contractually: agents that strip the sponsored flag lose API access. The transparency is a product invariant, not a feature.
5. Multimodal from day one. Recommendations aren't just text — products have images, videos have thumbnails, services have demo clips. The API returns multimodal payloads so the agent can render a hotel photo or a 5-second demo video alongside the text. A text-only ad system would be obsolete the day it shipped.
6. MCP integration over proprietary SDK. We could ship a vendor SDK and lock agents to our integration. Instead we ship an MCP server. Any MCP-compatible agent (Claude, Cursor, Cline, Continue, custom) can call MemContext-Ad with zero vendor lock-in. The platform wins by being the most useful, not by being the only option.
# Backend
pip install -r requirements.txt
cp .env.default memdemo/.env # add your LLM API key
python memdemo/app.py # http://localhost:5019
# Frontend (separate terminal)
cd memdemo/frontend
npm install
npm run dev # http://localhost:5173Open http://localhost:5173 to chat with the demo agent and see live recommendations with transparency tags.
The vision: the AdSense of the agentic web. Whenever an agent helps a user decide, MemContext-Ad is the reason creators get paid and users still feel served.
| Status | Feature |
|---|---|
| ✅ shipped | API for agents (intent + memory in, ranked recommendations out) |
| ✅ shipped | Memory-aware ranking via RAG |
| ✅ shipped | Multimodal recommendation payloads |
| ✅ shipped | MCP server (memcontext-mcp) for agent integration |
| ✅ shipped | Demo chat frontend |
| 🚧 next | Creator bidding console — set bids by intent/category |
| 🚧 next | Conversion tracking + settlement |
| 🚧 next | User-side memory controls — opt out of categories |
| 🔭 future | Agent reputation system — track which agents disclose honestly |
| 🔭 future | Brand verification — only verified creators can bid |
| What it does | How MemContext-Ad differs | |
|---|---|---|
| Google AdSense / Meta Ads | Display ads to humans | Built for the human-clicking-on-ads era. Agents don't click. |
| Amazon Associates / Impact / ShareASale | Affiliate links for human-readable websites | Requires the user to click the link. In agent flows, there's no link to click. |
| Perplexity Ads | Sponsored answers in an AI search engine | Inline-rendered to the user. We're API-first, agent-mediated, and multimodal. |
| Custom GPT Store revshare | OpenAI revenue share for custom GPTs | One-platform-only, not transactional, not memory-aware. |
- Backend (
memdemo/) — Flask API, memory + LLM + RAG - Frontend (
memdemo/frontend/) — React + TypeScript + Vite chat demo - Core memory (
memcontext/) — long-term memory engine - MCP server (
memcontext-mcp/) — Model Context Protocol integration
See LICENSE.