Quick Start Guide

Recommended demo

Use the clean Drift Guard walkthrough

If you are showing AgentCache to a buyer or design partner, skip the generic tour and use the dedicated Execution Drift Guard demo path.

1. Get Your API Key

Create an account at agentcache.ai/signup, finish onboarding, then open your workspace dashboard to generate an API key and copy your default namespace.

2. Install SDK

npm install agentcache-client

3. Initialize Client

import { AgentCache } from 'agentcache-client';

const cache = new AgentCache({
  apiKey: 'ac_live_your_key',
  baseUrl: 'https://agentcache.ai',
  namespace: 'default'
});

Optional: Test The API Directly

curl -X POST https://agentcache.ai/api/cache/set \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Cache-Namespace: default" \
  -d '{
    "provider": "openai",
    "model": "gpt-4o-mini",
    "messages": [{"role":"user","content":"What is 2+2?"}],
    "response": "4"
  }'

4. Cache AI Responses

const cached = await cache.get({
  provider: 'openai',
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'What is 2+2?' }]
});

if (cached.hit) {
  console.log('Cache hit!', cached.value);
} else {
  const response = await openai.chat.completions.create({
    model: 'gpt-4o-mini',
    messages: [{ role: 'user', content: 'What is 2+2?' }]
  });

  await cache.set(
    {
      provider: 'openai',
      model: 'gpt-4o-mini',
      messages: [{ role: 'user', content: 'What is 2+2?' }]
    },
    response.choices[0].message.content
  );
}

AgentCache Core is designed to sit above provider choice. The same cache contract works with hosted providers like OpenAI, Anthropic, and Gemini, and with open-local runtimes through Ollama. If you are serving a Gemma-family model locally, use provider: 'ollama' and the model tag you installed on your Ollama node.

5. Cache Tool Calls

const toolInput = JSON.stringify({ city: 'San Francisco' });

const weatherCache = await cache.get({
  provider: 'tool',
  model: 'get_weather',
  messages: [{ role: 'user', content: toolInput }]
});

if (!weatherCache.hit) {
  const weather = await fetchWeather('San Francisco');
  await cache.set(
    {
      provider: 'tool',
      model: 'get_weather',
      messages: [{ role: 'user', content: toolInput }]
    },
    weather,
    { ttl: 1800 }
  );
}

6. Monitor Your Savings

const stats = await cache.stats();

console.log(`Cache hit rate: ${stats.metrics.hit_rate}%`);
console.log(`Money saved: ${stats.metrics.cost_saved}`);
console.log(`Requests cached: ${stats.metrics.total_requests}`);

7. Start With Execution Drift Guard

Once your first workflow runs, use AgentCache to evaluate whether it stayed on the expected execution path before you trust it with higher-stakes automation. For the cleanest walkthrough, use the dedicated demo path.

curl -X POST https://agentcache.ai/api/execution/runs/YOUR_RUN_ID/evaluate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "mode": "shadow"
  }'

8. Paid Pilot Demo Flow

This is the fastest commercial demo path we would run with a design partner. The full copy-paste walkthrough lives on the Execution Drift Guard demo page.

  1. Create an API key and namespace in the workspace dashboard.
  2. Create one execution context pack and one run.
  3. Call Drift Guard in shadow mode.
  4. Show the resulting recommendations, expected path, actual path, and why the run passed or drifted.
  5. For storage pilots, store one artifact, link it to memory, then recall it by context instead of raw key.

9. Pilot Readiness Checklist

  • A live API key and namespace exist for the pilot workspace.
  • One cache-backed workflow can be demonstrated end to end.
  • One drift evaluation can be produced with a receipt.
  • For storage pilots, one real artifact can be stored and recalled through the pilot path.
  • Buyer-facing success metrics are defined: latency saved, spend reduced, risky runs flagged, or artifacts retrieved.

🎉 You're All Set!

You're now caching AI responses and saving money. Check out the full documentation for advanced features.

Open Drift Guard Demo