Quick Start

API

Fastmem — Memory and Context Engineering for AI Apps

Give your AI app long-term memory and task-ready context. Fastmem extracts facts from conversations, tracks structured state and constraints, and can build the final context packet your app sends to an LLM.

✓ Auto fact extraction from text ✓ Semantic search with similarity scores✓ Structured context packets for app/LLM turns ✓ Context buckets for isolation ✓ Memory quality scoring ✓ Full audit trail & debugger
-
Memories
-
Users
-
Requests 24h
1 Install the SDK
pip npm
pip install fastmem
2 Initialize with your API key
Python JavaScript cURL
from fastmem import FastmemClient

memory = FastmemClient(
    api_key="your-api-key"
)
3 Add your first memory
Python JavaScript cURL
# Add memories - facts are automatically extracted
result = memory.add(
    user_id="user_123",
    text="I'm allergic to peanuts and I work at Google"
)

print(f"Added {result.memory_count} memories")
4 Search memories (primitive API)
Python JavaScript cURL
# Search for relevant memories
results = memory.search(
    user_id="user_123",
    query="What food allergies does this user have?"
)

for mem in results:
    print(f"- {mem.text} (score: {mem.score:.2f})")
5 Build structured context for your app / LLM
import requests

resp = requests.post(
    "https://api.fastmem.ai/api/context/build",
    headers={"X-API-Key": "your-api-key", "Content-Type": "application/json"},
    json={
        "user_id": "user_123",
        "task_id": "camera_shopping",
        "query": "What is the price of Canon R6 and is it within my budget?",
        "context": "shopping",
        "output_format": "markdown"
    }
)

packet = resp.json()
print(packet["formatted_context"])
print(packet["summary"])

Use the primitive APIs when you want raw memories. Use the context builder when you want Fastmem to assemble the structured packet for the next LLM call.

How Developers Use Fastmem

AI Chatbots

Your chatbot remembers user preferences, past conversations, and personal details across sessions.

Context buckets keep work/personal separate

Shopping Agents

Track budgets, constraints, and preferences. Build context packets with exact prices, rules, and semantic facts.

Structured state + constraints + verbatim values

Health & CRM Apps

Multi-party memory with speaker roles. Track what patients/clients say vs. what professionals note.

Tenant isolation + speaker roles + audit trail

How It Works
Your App sends text
Fastmem extracts facts
Stores with embeddings
Semantic search retrieves
Builds context packet for LLM

Fastmem sits between your app and the LLM. It stores memories, your app generates responses.

Ready to try it?

Test memory extraction, search, and context building in the Playground

Add Memory
or
Search
Context Builder

Returns the structured packet and formatted context your app would pass into an LLM.

User Memories (0)

Select or enter a user to see their memories

-
Total Memories
-
Total Users
-
Total Contexts
-
Active Users (7d)
Top Context Prefixes
PrefixMemoriesUsers
Top Users by Memory Count
User IDMemories
Memory Growth (Last 30 Days)
Memories by Category
Users 0 users

Loading users...

Memories

Select a user to view memories

Context Browser 0 contexts
Context Memories Users Latest Activity
Search Query
Lifecycle Classifier

Enter any text to see how Fastmem classifies it — temporal type, TTL, and salience.

Evolution Timeline

Track how user preferences and facts change over time

Search Topic Evolution
Evolution Insights

Select a user and click "Load Insights" to see patterns

API Reference

Complete reference for the Fastmem REST API

POST /api/add

Add memories from text. Automatically extracts facts using AI.

Request Body

{
  "user_id": "string",     // Required: Unique user identifier
  "text": "string",        // Required: Text to extract memories from
  "context": "string"      // Optional: Context bucket (default: "default")
}
Python cURL
import requests

response = requests.post(
    "https://api.fastmem.ai/api/add",
    headers={"X-API-Key": "your-api-key"},
    json={
        "user_id": "user_123",
        "text": "I'm allergic to peanuts",
        "context": "health"
    }
)
print(response.json())
GET /api/memories

List all memories for a user with optional filtering.

Query Parameters

user_id (required) - User identifier
context (optional) - Filter by context
category (optional) - Filter by category

View all endpoints in the interactive API documentation

Open Swagger UI
Request Logs Live
Time Method Endpoint Status Latency

No logs yet

Make some API calls to see logs here

Account
OpenAI Key
API Keys
Account Details
Email
-
App Name
-
App Type
-
Tenant ID
-
Trial Credits
-
App Profile
Current Session
Key Prefix
-
Scopes
-
OpenAI API Key

Provide your own OpenAI API key for unlimited usage. Without it, you're limited to trial credits.

API Keys

Loading keys...