For Support & Companion AI

Give Your Chatbot Long-Term Memory

Users hate repeating themselves. Ctxfy turns disjointed chat sessions into a continuous relationship. Enable your bot to remember names, preferences, and context across days, weeks, or years.

The User Experience Gap

The Goldfish Bot (Standard)

  • Treats every new session as the first one
  • Users frustrated by re-explaining context
  • Zero personalization
  • High churn rate

The Ctxfy Bot (Stateful)

  • Remembers context from last week
  • Instantly personalized greeting
  • Summarizes past decisions automatically
  • Feels like a real conversation

Architecture: The 'Resume' Pattern

Session 1 Ends

User chats for 30 mins about a React bug. Session closes.

Compression (Background)

Ctxfy API runs on the closed session, extracting key facts: 'User is using Next.js 14', 'Error is hydration mismatch'.

Database Store

The compressed 'State Object' (500 tokens) is saved to the user's profile in your DB.

Session 2 Starts (Next Week)

Bot loads the State Object into the system prompt. It immediately asks: 'Did you fix that hydration error?'

Built for Continuity

Customer Support AI

When a user returns after 3 days, the bot shouldn't ask 'How can I help?'. It should ask 'Did the refund go through?'. This reduces ticket reopening rates.

AI Companions & RP

For roleplay apps, memory is the product. Ctxfy allows characters to remember plot points, relationship status, and inventory across thousands of messages without hitting token limits.

session-manager.js
// On new session start
async function startSession(userId) {
  // 1. Fetch compressed memory from DB
  const userMemory = await db.memories.get(userId);
  
  // 2. Inject into System Prompt
  const systemPrompt = `
    You are a helpful assistant.
    Current Date: ${new Date()}
    
    LONG TERM MEMORY:
    ${userMemory.state_content}
  `;

  // 3. Start chat with context, 0 token cost for old history
  return llm.chat({ system: systemPrompt, messages: [] });
}

Frequently asked questions

It's better than RAG for conversation. RAG retrieves random snippets based on keywords. Ctxfy provides a coherent *summary state* of the relationship, preserving the narrative flow.

The state object is text. You own it. You store it in your database. Ctxfy processes it and forgets it.

Yes. You can merge new session states into the old memory block, creating an evolving user profile.

Memory builds loyalty.

Stop building bots that forget. Start building relationships.