Back to Builder Stories

memoryaf

Shared team memory for AI agents — MCP server, REST API, and dashboard backed by Antfly hybrid search.

10
MCP tools
3
Memory types
team
Shared memory across agents
hybrid
Semantic + full-text search
memoryaf

What it is#

memoryaf gives your AI agents persistent, searchable long-term memory — across sessions, teammates, and projects. It exposes an MCP server (for Claude Code, Cursor, and other MCP clients), a REST API (for any agent framework), and a web dashboard for browsing and managing memories. All backed by Antfly hybrid semantic + full-text search.

How it works#

memoryaf supports three types of memory:

  • Episodicwhat happened. Chronological events: incidents, debugging sessions, decisions made in context.
  • Semanticwhat we know. Factual knowledge: architecture decisions, conventions, preferences.
  • Proceduralhow to do things. Workflow templates: runbooks, checklists, standard procedures.

On first startup, memoryaf auto-creates tables in Antfly with both a full-text index and an AKNN vector index. When you search, both indexes are queried and results are merged using reciprocal rank fusion, so you get the best of exact keyword matches and semantic similarity.

When Antfly Inference is available with the GLiNER2 model, memoryaf automatically extracts named entities (people, technologies, services, projects) from every memory and links them in an Antfly graph index — powering related-memory discovery and graph-expanded search.

Stack#

  • Runtime: Node.js + TypeScript
  • MCP SDK: @modelcontextprotocol/sdk
  • Database: Antfly via @antfly/sdk
  • Dashboard: Next.js
  • Embeddings: Antfly built-in (bge-small-en-v1.5, 384d), or Antfly Inference/Ollama for higher-quality models
  • Entity Extraction: Antfly Inference with GLiNER2
  • Search: Hybrid BM25 + AKNN vector with reciprocal rank fusion
Architecture
1
MCP Server
Exposes 10 tools over the Model Context Protocol for Claude Code, Cursor, and other MCP clients
2
REST API
HTTP API for any agent framework — Codex CLI, custom agents, or direct integration
3
Web Dashboard
Browse, search, and manage memories visually with stats, entity graphs, and filters
4
Antfly Client
@antfly/sdk manages table and index creation, CRUD, and hybrid search
5
Hybrid Index
Full-text BM25 index + AKNN vector index, fused with reciprocal rank fusion
6
Entity Extraction
Automatic named-entity recognition via Antfly Inference/GLiNER2, linked in an Antfly graph index