The intelligence layer
for AI agents

Connect data sources. Manage context windows. Observe everything. Without the chaos.

Facebook AdsGoogle AdsPostgresFirecrawlGoogle DriveTikTok Ads

All the context that flows from your data sources builds a universal memory you can search at any time.

Short-Term<50k

Immediate awareness. Auto-compacted summaries of live context. Always included in every query.

Mid-Term50k–1M

Working knowledge via Activation Beacon. ~85% compression with full semantic fidelity.

Long-Term>1M

Deep archives. Auto-rollover to vector storage for semantic search across history.

How Datagran Solves Context

AI agents need more than prompts. They need the right knowledge at the right time, managed context that doesn't overflow, and visibility into every decision they make.

Plug Knowledge

Connect your AI to the data sources it needs—ads platforms, CRMs, databases, files—in one click. No custom integrations. No token management headaches.

FacebookGoogle AdsPostgres+8 more
Core

Manage Context

Three memory layers that work like a human brain—short-term for live context, mid-term for compressed knowledge, long-term for infinite history.

Short-term:<50k
Mid-term (Beacon):~85% compressed
Long-term (RAG):unlimited

Observe Everything

See every decision your AI makes in real-time. Track what context was used, what actions were taken, and why. Full audit trails for compliance and debugging.

Real-time traces
Policy enforcement
Risk scoring
Real Use Case

See Beacon Compression in Action

We scraped the Wikipedia Paris article using Firecrawl. Watch how 267,065 tokens compress into 46,080 beacon KV positions—~6x KV cache reduction with sub-second query latency.

1Scrape with Firecrawl2Beacon Compression3Query Instantly
Firecrawl
Wikipedia: Paris
Scraped via Firecrawl
en.wikipedia.org/wiki/Paris

## Paris

Paris is the capital and largest city of France, with an official estimated population of 2,102,650...

### History

- Founded: 3rd century BC (as Lutetia)

- Population: ~2.1 million (city), ~12 million (metro)

- Landmarks: Eiffel Tower, Louvre, Notre-Dame...

- Economy: Tourism, finance, fashion, art...

Raw token count267,065 tokens
Activation Beacon
~6x
KV Reduction
Before267K tok
After46K beacon KV
KV Cache Savings
~221K tokens saved
Live Query
U
What is the population of Paris?
AI
Answered from 46K beacon KV
According to the most recent statistics, the population of Paris is around 2.2 million people.
Warm Latency
~1s
sub-second responses
KV Cache
~6x
memory reduction
~6x
KV Cache Reduction
267K tokens → 46K beacon KV
~1s
Warm Query Latency
Sub-second responses on warm GPU
1→∞
Compile Once, Query Forever
Beacons persist across sessions

How Beacon Compression Works

1. Tokens Enter

Your document's 267K tokens are fed into the Activation Beacon model chunk by chunk (8K tokens per chunk).

2. Compress to Beacons

With compression ratio α=8, tokens compress into beacon KV activations—resulting in ~6x memory reduction.

3. Answer from Beacons

The model uses the 46K beacon KV cache instead of the full 267K—sub-second latency on warm GPU.

AIC (AI Interaction Controller)

The enforcement engine that ensures every AI action is safe. Risk scoring, policy checks, approval flows, and complete observability—all in one place.

AIC Enforcing Policy...
U

Create a new campaign with $5,000 budget

AIC
Policy Check: High Spend

This request exceeds the auto-approval limit ($1,000). I've flagged this for human review before execution.

1. Risk Scoring

Evaluates context, intent, and historical patterns.

2. Policy Enforcement

Checks against budget limits, allowed actions, and targets.

3. Observability

Logs full trace, including prompt, response, and API payload.

Get Started in Minutes

Build AI agents with persistent memory. Query your brain first, fetch only what's missing.

1

Create Account

Sign up at the Partner Portal and grab your API keys in seconds.

2

Connect to any of our Integrations

Connect to OAuth data sources and more with a click.

3

Connect Your AI

Use our MCP server for Claude/Cursor, or call our REST API directly.

4

Enable Memory

Toggle auto-compile in the Partner Portal to retain data as persistent brain memory.

5

Query the BrainKEY

Call /api/context/brain first to check if data already exists in memory.

6

Fetch if Empty

No memory? Fetch from integrations. Data auto-compiles to the brain for next time.

AI
Your Agent
🧠
Query Brain
Data already compiled?
✓ YESReturn answer instantly
✗ NOFetch → Auto-compile → Answer

Result: Your AI only fetches data once. Every subsequent query hits the brain—instant answers, lower costs, persistent memory across sessions.

Case Studies

See how enterprises are securing their AI

Compensar Logo

Marketing AI with Full Observability and Control

Challenge

Needed a way to safely give AI agents access to marketing systems without risking campaign tampering, data leaks, or untraceable decisions.

Solution

Implemented Datagran as middleware between AI agents and ad platforms (Meta, Google Ads). Provided a secure proxy, real-time observability, and automated performance reporting.

Results

  • 100% visibility into all AI-initiated ad actions
  • Improved ad performance through automated content learning
  • Full audit trails for marketing ops and leadership
  • Reduced risk of unauthorized changes
Telerion Logo

Securing AI Agents in Government Customer Support

Challenge

Deploying AI agents in sensitive support roles requiring access to CRMs and APIs, while meeting strict government compliance and audit standards.

Solution

Integrated Datagran as a control layer to enforce fine-grained action control, real-time monitoring, and risk evaluation for every API call.

Results

  • Met internal/client security requirements for AI
  • prevented unauthorized or destructive calls
  • Enabled broader AI rollout in sensitive workflows
  • Built trust through transparent tracking

Platform Capabilities

Everything your AI agents need to be smart, safe, and observable

Compiled Context

Turn large documents, datasets, and conversation history into compressed, reusable memory. Your AI remembers everything without hitting token limits. 85%+ compression with instant recall.

One-Click Integrations

Connect to Facebook, Google Ads, LinkedIn, TikTok, Postgres, and more with OAuth. No token management, no refresh logic—just plug and query. Your AI gets the data, you keep control.

Real-Time Observability

See every decision your AI makes as it happens. Track which context was loaded, what sources influenced the answer, and drill down into network calls. Replay any session instantly.

Policy & Risk Engine

Define guardrails: budget limits, allowed actions, approval workflows. Every request is scored for risk and checked against your policies before execution. Block bad actors automatically.

Model Context Protocol

MCP Server for AI Agents

Connect Claude, Cursor, Replit, or any MCP-compatible AI to marketing APIs instantly

MCP Server URL

Add this to your MCP client configuration

https://datagran-mcp.fly.dev/mcp
🤖

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "datagran": {
      "url": "https://datagran-mcp.fly.dev/mcp"
    }
  }
}

Cursor IDE

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "datagran": {
      "url": "https://datagran-mcp.fly.dev/mcp"
    }
  }
}

Available MCP Tools

Brain & Memory

query_brain

Query unified memory (recommended first step)

compile_context

Manually compile data to memory

query_with_context

Query specific memory by ID

list_compiled_memories

List all compiled memories

Connection & Authentication

check_connection_status

Check if a provider is connected

show_marketing_console

Open OAuth widget to connect

Data Fetching

execute_script

Run API calls on marketing platforms

postgres_query

Query PostgreSQL databases

google_ads_accounts

List Google Ads accounts

Web Pixel Analytics

web_pixel_get_stats

Get analytics: visitors, sessions, signups

web_pixel_list_users

List identified users with emails

web_pixel_list_sites

List all pixel sites

Web Scraping (Firecrawl)

firecrawl_scrape

Scrape single URL content

firecrawl_crawl

Crawl entire websites

firecrawl_map

Map all URLs on a website

firecrawl_search

Web search with scraping

firecrawl_extract

Extract structured data with AI

Supports Facebook AdsInstagram Google AdsGoogle Drive Google CalendarSalesforce LinkedIn AdsTikTok Ads PostgresFirecrawl Web Pixel

Knowledge Sources

One-click access to the platforms your AI needs

Connect in One Click

Facebook Ads

Facebook Ads

Access ad accounts, campaigns, ad sets, and performance metrics.

Facebook Leads

Facebook Leads

Capture lead submissions via the dedicated leads_retrieval scope.

Instagram

Instagram

Read account insights via the instagram_manage_insights scope.

Google Ads

Google Ads

Auto-link to our manager, execute scripts, and centralize spend + performance.

LinkedIn Ads (Closed Beta)

LinkedIn Ads (Closed Beta)

Map Sponsored Accounts once and launch campaigns or creatives via our proxy. Scopes: r_ads_reporting · rw_organization_admin · r_ads · rw_ads.

Google Drive

Google Drive

Read files, metadata, and exports via our secure proxy.

Google Calendar

Google Calendar

Create events, check availability, and manage calendars via our secure proxy.

Gmail

Gmail

Read emails, search inbox, and send messages via our secure proxy.

Salesforce

Salesforce

Query and write CRM data via the Salesforce REST API—securely proxied by Datagran.

TikTok Ads

TikTok Ads

Full marketing API access—advertisers, campaigns, reporting, leads, measurement, and ad comments.

Postgres / Supabase

Postgres / Supabase

Full SQL proxy with encrypted credentials, SSRF protection, audit logs, and query observability.

Firecrawl

Firecrawl

Web scraping, crawling, and structured data extraction. Scrape any URL, crawl entire sites, or extract data using LLM schemas.

Web Pixel

Web Pixel

First-party analytics pixel. Track page views, sign-ups, sign-ins, and identify users with email. Lightweight JS snippet.

Infrastructure Security

Bank-Level Security

Your users trust you with their data. We protect it like our own.

AES-256-GCM Encryption

All OAuth tokens are encrypted at rest using military-grade AES-256-GCM encryption. Each token has its own unique initialization vector and authentication tag for maximum security.

Zero Token Exposure

Tokens never touch your application or frontend. All API requests go through our secure data proxy—your partners only receive the data they need, never the raw credentials.

PKCE OAuth Flow

We implement OAuth 2.0 with PKCE (Proof Key for Code Exchange) to prevent authorization code interception attacks. Every auth session has unique challenge/verifier pairs.

API Key Hashing

Partner API keys are hashed with bcrypt (10 rounds) before storage. We never store plain-text keys—even we can't see your partners' credentials after creation.

Origin Whitelisting

Strict CORS enforcement and origin validation. The auth widget only opens from pre-approved domains, preventing unauthorized access attempts and phishing attacks.

Audit Logs

Complete audit trail of all authentication events, token refreshes, and API access. Track every action for compliance and security monitoring.

Data Deletion & Compliance

Full GDPR compliance with automated data deletion workflows. When users disconnect or delete their accounts, we automatically revoke tokens and purge all related data from our systems.

Ready to Supercharge Your Agents?

Give your AI the context it needs, the knowledge it deserves, and the observability you require. All in minutes.