Memory

For Coding Agents

memory.md

AGNT Memory

Persistent context storage for AI agents. Memories are structured pieces of information — notes, preferences, facts, and contextual data — that agents retrieve and use to make better decisions over time.

Why AGNT Memory

Without memory, every AI interaction starts from zero. The agent doesn't know that the user prefers morning meetings, that Q2 planning starts in April, or that the CEO's assistant handles travel bookings. AGNT Memory fixes this.

Memories are typed, tagged, and time-bounded. A preference like "I prefer window seats" has no expiration. A fact like "Q2 planning starts April 7th" has a start date. A context note like "On vacation March 15-22" has both a start and end date. The agent queries memories at execution time and gets back exactly the context it needs.

This isn't a vector database. It's a structured memory system designed for agent consumption — searchable, filterable, and scoped to individual users.

Quick Start

Store a preference and a time-bounded fact:

bash
# Store a preference
curl -X POST https://api.agnt.ai/memories \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Prefers 30-minute meetings over 60-minute meetings",
    "type": "preference",
    "tags": ["scheduling", "meetings"]
  }'

# Store a time-bounded fact
curl -X POST https://api.agnt.ai/memories \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Out of office March 15 through March 22. Sarah is covering.",
    "type": "context",
    "tags": ["availability", "ooo"],
    "startDate": "2026-03-15T00:00:00.000Z",
    "endDate": "2026-03-22T23:59:59.000Z"
  }'

# Retrieve memories by tag
curl "https://api.agnt.ai/memories?tags=scheduling&type=preference" \
  -H "Authorization: Bearer $TOKEN"

Core Concepts

Memory Types

Every memory has a type that describes what kind of information it holds:

TypePurposeExample
noteGeneral-purpose information"Jane's team uses Notion for project tracking"
preferenceUser preferences that guide agent behavior"Prefers email over Slack for formal communications"
factObjective information the agent should know"Company fiscal year starts in July"
contextSituational information, often time-bounded"Preparing for board presentation on March 28th"

Types are for filtering and agent decision-making. The agent can query for all preference memories to understand how a user likes things done, or all context memories to understand what's currently happening.

Tags

Tags are freeform strings. Use them to categorize memories by domain: scheduling, communication, travel, team, projects. Tags are the primary filtering mechanism — most agent queries will filter by tags relevant to the current task.

There's no tag taxonomy. Use whatever makes sense for your domain. The agent will use tags that match its current context.

Time Boundaries

Memories can have startDate, endDate, both, or neither:

  • No dates: Permanent memory. Always relevant. Preferences typically have no dates.
  • startDate only: Relevant from that date forward. "Starting Q3, the team standup moves to 9:30am."
  • endDate only: Relevant until that date. "Conference room B is under renovation until April."
  • Both dates: Relevant during that window. "On vacation March 15-22."

Agents should query with the current date and use time boundaries to determine relevance. Expired memories aren't deleted — they're still queryable but the agent knows they're historical.

User Scoping

Memories are scoped to the user identified in the delegated JWT. When you store a memory, it's attached to that user. When you query memories, you only get memories for that user. There's no cross-user memory access.

This means each user builds their own context over time. The agent learns about Jane's preferences separately from Bob's preferences.

API Reference

Endpoints

MethodPathDescription
GET/memoriesList memories
POST/memoriesCreate a memory
GET/memories/:memoryIdGet a memory
PUT/memories/:memoryIdUpdate a memory
DELETE/memories/:memoryIdDelete a memory

Memory Object

json
{
  "id": "mem_abc123",
  "account": "acc_org789",
  "user": "user_jane456",
  "content": "Prefers 30-minute meetings over 60-minute meetings",
  "tags": ["scheduling", "meetings"],
  "type": "preference",
  "startDate": null,
  "endDate": null,
  "source": "api",
  "metadata": {},
  "createdAt": "2026-02-20T09:00:00.000Z",
  "updatedAt": "2026-02-20T09:00:00.000Z"
}
FieldTypeDescription
idstringUnique memory identifier
accountstringOrganization account ID
userstringUser ID (from delegated JWT)
contentstringThe memory content — what the agent should know
tagsarrayFreeform tags for filtering
typestringnote, preference, fact, or context
startDatestring/nullISO 8601 start date (when the memory becomes relevant)
endDatestring/nullISO 8601 end date (when the memory stops being relevant)
sourcestringHow the memory was created (e.g., api, agent, chat)
metadataobjectArbitrary key-value metadata
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-update timestamp

List Memories

GET https://api.agnt.ai/memories
ParameterTypeDescription
tagsstringComma-separated tag filter (e.g., scheduling,meetings)
typestringFilter by type: note, preference, fact, context
searchstringFull-text search across memory content
pagenumberPage number (default: 1)
perPagenumberResults per page (default: 20)
bash
curl "https://api.agnt.ai/memories?tags=scheduling&type=preference&page=1&perPage=50" \
  -H "Authorization: Bearer $TOKEN"
json
{
  "data": [
    {
      "id": "mem_abc123",
      "account": "acc_org789",
      "user": "user_jane456",
      "content": "Prefers 30-minute meetings over 60-minute meetings",
      "tags": ["scheduling", "meetings"],
      "type": "preference",
      "startDate": null,
      "endDate": null,
      "source": "api",
      "metadata": {},
      "createdAt": "2026-02-20T09:00:00.000Z",
      "updatedAt": "2026-02-20T09:00:00.000Z"
    },
    {
      "id": "mem_def456",
      "account": "acc_org789",
      "user": "user_jane456",
      "content": "No meetings before 9am or after 5pm Eastern",
      "tags": ["scheduling", "availability"],
      "type": "preference",
      "startDate": null,
      "endDate": null,
      "source": "chat",
      "metadata": {},
      "createdAt": "2026-02-18T11:30:00.000Z",
      "updatedAt": "2026-02-18T11:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 50,
    "total": 2
  }
}

Create Memory

POST https://api.agnt.ai/memories
FieldTypeRequiredDescription
contentstringYesThe memory content
tagsarrayNoFreeform tags for categorization
typestringNonote, preference, fact, or context (default: note)
startDatestringNoISO 8601 date when the memory becomes relevant
endDatestringNoISO 8601 date when the memory stops being relevant
metadataobjectNoArbitrary key-value metadata
bash
curl -X POST https://api.agnt.ai/memories \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "The engineering team does sprint planning every other Monday at 10am Eastern",
    "type": "fact",
    "tags": ["scheduling", "engineering", "recurring"],
    "metadata": {
      "confidence": "high",
      "source_chat": "chat_xyz789"
    }
  }'
json
{
  "id": "mem_new001",
  "account": "acc_org789",
  "user": "user_jane456",
  "content": "The engineering team does sprint planning every other Monday at 10am Eastern",
  "tags": ["scheduling", "engineering", "recurring"],
  "type": "fact",
  "startDate": null,
  "endDate": null,
  "source": "api",
  "metadata": {
    "confidence": "high",
    "source_chat": "chat_xyz789"
  },
  "createdAt": "2026-03-01T10:00:00.000Z",
  "updatedAt": "2026-03-01T10:00:00.000Z"
}

Get Memory

GET https://api.agnt.ai/memories/:memoryId
bash
curl https://api.agnt.ai/memories/mem_abc123 \
  -H "Authorization: Bearer $TOKEN"
json
{
  "id": "mem_abc123",
  "account": "acc_org789",
  "user": "user_jane456",
  "content": "Prefers 30-minute meetings over 60-minute meetings",
  "tags": ["scheduling", "meetings"],
  "type": "preference",
  "startDate": null,
  "endDate": null,
  "source": "api",
  "metadata": {},
  "createdAt": "2026-02-20T09:00:00.000Z",
  "updatedAt": "2026-02-20T09:00:00.000Z"
}

Update Memory

PUT https://api.agnt.ai/memories/:memoryId

Update any field on the memory. Partial updates are supported — only include the fields you want to change.

bash
curl -X PUT https://api.agnt.ai/memories/mem_abc123 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Prefers 25-minute meetings (not 30) to leave buffer time between calls",
    "tags": ["scheduling", "meetings", "time-management"]
  }'
json
{
  "id": "mem_abc123",
  "account": "acc_org789",
  "user": "user_jane456",
  "content": "Prefers 25-minute meetings (not 30) to leave buffer time between calls",
  "tags": ["scheduling", "meetings", "time-management"],
  "type": "preference",
  "startDate": null,
  "endDate": null,
  "source": "api",
  "metadata": {},
  "createdAt": "2026-02-20T09:00:00.000Z",
  "updatedAt": "2026-03-01T10:10:00.000Z"
}

Delete Memory

DELETE https://api.agnt.ai/memories/:memoryId

Permanently deletes the memory. Irreversible.

bash
curl -X DELETE https://api.agnt.ai/memories/mem_abc123 \
  -H "Authorization: Bearer $TOKEN"
json
{
  "deleted": true
}

For Coding Agents

If you're an AI coding agent integrating with AGNT Memory, here's what matters:

  1. Query before acting. Before scheduling a meeting, query tags=scheduling&type=preference. Before sending an email, query tags=communication&type=preference. The five seconds you spend querying saves the user from correcting you.

  2. Write memories from conversations. When a user says "I prefer mornings for deep work," create a memory. When they mention "Our fiscal year starts in July," create a memory. The best memory systems are fed continuously, not in bulk.

  3. Use type intentionally. Don't dump everything as note. Preferences guide behavior. Facts inform decisions. Context sets the scene. Notes are for everything else. The distinction matters when you're querying — you don't want a vacation OOO context mixed in with permanent scheduling preferences.

  4. Respect time boundaries. If a memory has an endDate in the past, it's historical context. Don't apply it as current truth. A memory like "On vacation March 15-22" with endDate: 2026-03-22 should not block scheduling on March 25.

  5. Use metadata for provenance. Store which chat or task generated the memory, confidence levels, or source references. This helps with debugging and gives future agents context about why a memory exists.

  6. Update, don't duplicate. If you find an existing memory that's close to what you want to store, update it. "Prefers 30-minute meetings" becoming "Prefers 25-minute meetings" is an update to the existing memory, not a new one alongside it. Search before you create.

  7. Tag consistently. Pick a tag vocabulary and stick with it. If one agent tags scheduling memories as scheduling and another uses calendar, queries will miss half the data. Establish conventions and follow them.

For Product Teams

AGNT Memory is how your AI agents get smarter over time without retraining, fine-tuning, or prompt engineering. Here's how to think about it:

Memory is the personalization layer. Every user gets their own memory space. As the agent interacts with a user, it accumulates knowledge about their preferences, their team, their workflow, and their calendar patterns. This happens automatically if agents are configured to write memories during conversations and task execution.

Time-bounded memories handle the real world. People go on vacation. Projects have deadlines. Fiscal years rotate. Time boundaries let you store information that's only relevant during a specific window, without manual cleanup. The agent checks dates at query time and handles relevance automatically.

Search and tags replace complex queries. You don't need a query language. Filter by tags, filter by type, or full-text search the content. For most agent workflows, tags=scheduling&type=preference is the entire query. Keep it simple.

Memory grows with usage. You don't need to seed the system with a complete user profile. Start with nothing. As users interact with agents, memories accumulate. After a few weeks, the agent knows enough about each user to be genuinely useful without being asked the same questions repeatedly.

Memories are auditable. Every memory has a source field showing where it came from (API, agent, chat). Combined with metadata, you have full provenance. Users can see what the agent "knows" about them and correct or delete anything that's wrong. This builds trust.

Not a vector store. AGNT Memory is structured data, not embeddings. You get exact matches on tags and types, full-text search on content, and time-boundary filtering. If you need semantic similarity search, use a vector database alongside Memory. They're complementary, not competing.