Every time a user returns to your AI application, they start over. No memory of preferences, no recall of past conversations, no accumulated context. Building memory from scratch means standing up a vector database, choosing an embedding model, writing retrieval logic, and managing storage. The Nayan Memory API handles all of it. Store facts, preferences, and commitments. Recall them by relevance. Namespace isolation keeps each user's memory separate.

Ask ChatGPT a question today and ask it the same question tomorrow. It does not remember the first conversation. This is not a bug. It is how stateless architectures work. Every API call starts from zero.

For simple Q&A tools, statelessness is fine. But the moment your AI application needs to feel personal, statelessness becomes a wall. A coaching bot that forgets what the user said last week is not a coach. A customer support agent that asks for the account number every time is not helpful. An AI writing assistant that cannot remember the user's style guide is just autocomplete with extra steps.

Users hate repeating themselves. That is the entire problem.

Why Building Memory Is Harder Than It Looks

The naive approach is to store conversation history and stuff it into the context window. This works until it does not. Context windows have limits. Token costs scale linearly with history length. And raw conversation logs are full of noise: the important facts are buried in small talk, corrections, and tangents.

The next step is usually a vector database. Embed each piece of information, store the vectors, run similarity search at recall time. This works well, but it is a significant infrastructure commitment: you need an embedding model (and its costs), a vector store (Pinecone, Weaviate, Qdrant, or self-hosted), a retrieval pipeline, and logic to decide what gets embedded and what gets discarded.

For a team building a memory system as their core product, that is a reasonable investment. For a team that just wants their chatbot to remember that the user prefers dark mode, it is overkill.

How the Memory API Works

The Nayan Memory API reduces memory to two operations: store and recall.

Store a piece of information:

# Store a user preference curl -X POST https://api.nayanleadership.com/v1/memory/store \ -H "Authorization: Bearer nayan_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "namespace": "user-42", "content": "Prefers concise answers over detailed explanations", "type": "preference", "importance": 0.8 }'

Recall relevant memories:

# Recall memories relevant to the current context curl -X POST https://api.nayanleadership.com/v1/memory/recall \ -H "Authorization: Bearer nayan_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "namespace": "user-42", "query": "How should I format this response?", "limit": 5 }'

The recall endpoint returns memories ranked by a composite relevance score. You inject them into your model's context window as system instructions or contextual background. The model never needs to know where the information came from.

The Scoring Algorithm

Not all memories are equally relevant at recall time. The API uses a four-factor scoring algorithm to rank memories:

Overlap. How well does the memory's content match the recall query? This is the semantic similarity component. A query about "response formatting" should surface the memory about preferring concise answers.

Importance. When you store a memory, you assign an importance score from 0 to 1. A user's name is importance 1.0. A casual mention of their favorite color is maybe 0.3. This lets you differentiate between core facts and incidental details.

Recency. More recent memories score higher than older ones, all else being equal. A preference stated yesterday is more likely to be current than one stated six months ago.

Frequency. Memories that have been recalled many times score higher. If the system keeps pulling the same memory, it is probably important. This creates a natural reinforcement loop where useful memories become more prominent over time.

The final score is a weighted combination of these four factors. The result is a ranked list of the most relevant memories for any given query.

Namespace Isolation

Every memory belongs to a namespace. This is how you keep different users' memories separate, even on the same API key. It is also how you separate different applications, environments, or contexts.

Typical namespace patterns:

Namespaces are strings. You define the pattern. The API enforces strict isolation: a recall query against namespace "user-42" will never return memories from namespace "user-43".

Memory Types

The type field when storing a memory helps you organize and filter. Common types include:

Preferences. How the user likes things done. Communication style, output format, language, level of detail.

Facts. Things that are true about the user. Name, role, company, timezone, team size.

Commitments. Things the AI said it would do or follow up on. "I told you I'd check on the pricing update" is a commitment that should surface the next time pricing comes up.

Context. Background information the user has provided over time. Industry context, project details, organizational dynamics.

You can filter recall queries by type, so if you only want preferences for a formatting decision, you do not get flooded with facts and commitments.

Who Should Use This

Chatbot developers. If your bot has returning users, they expect continuity. Memory is the difference between a tool and an experience.

AI agent builders. Agents that run multi-step workflows need persistent context. What did the user approve in step one? What constraints did they set? Memory keeps agents aligned across sessions.

SaaS products with AI features. Your AI-powered onboarding flow, your smart assistant, your automated report builder. All of them are better when they remember who they are talking to.

Getting Started

The free tier includes 500 memory operations per month (stores and recalls combined). That is enough to build and test a memory-enabled prototype. Paid plans scale with your usage. Sign up at api.nayanleadership.com.

Key Takeaways