Back to blog

Mind Memory Lab: Memory-Oriented Agent Framework

Memory-oriented agent framework prototype validating long-term memory and dialogue continuity, with pluggable LLM adapters and SQLite FTS full-text indexing.

#AI#Agent#Memory#TypeScript#SQLite#pnpm

Project Overview

Mind Memory Lab is a memory-oriented agent framework laboratory prototype, aiming to validate the feasibility of long-term memory and conversation continuity in LLM applications. Core focus includes: controlled information retrieval, workspace isolation, and turn-level orchestration.

Technical Architecture

Project uses pnpm monorepo organization (9 packages + 1 app):

PackageResponsibilityTests
@mind/kernelTurn pipeline, domain types, LLM ports5 passed
@mind/memoryMemory persistence, chunking, SQLite FTS indexing8 passed
@mind/workspaceWorkspace sandbox and ignore rules3 passed
@mind/adapters-llmAnthropic / OpenAI / Ollama / Alibaba Cloud adapters3 passed
@mind/agent-hostMulti-turn tool orchestration AgentToolLoop-
@mind/tools-coreRead-only workspace tools and ToolPolicy-
@mind/agent-contractAgent tools and MCP/Hooks/Skills port typesNo runtime deps
@mind/native-mindmemN-API bindings (optional)Fallback verified
c/C99 primitives (chunking, fingerprinting, counting)-
@mind/webWeb UI + local API-

Web UI Features

  • Chat: AI Agent chat interface (session management, streaming response, thinking process display)
  • Memory Library: Memory item management (list browsing, filtering, detail viewing)
  • Search: Full-text search functionality

Core Design

Workspace Sandbox

Read-only access control based on workspace sandbox:

interface WorkspaceSandbox {
  rootPath: string
  ignorePatterns: string[]  // gitignore format
  allowPatterns: string[]   // whitelist
  canAccess(path: string): boolean
  readFile(path: string): Promise<string>
}

Memory System

SQLite FTS5 full-text indexing:

interface MemoryStore {
  store(entry: MemoryEntry): Promise<void>
  search(query: string, limit: number): Promise<MemoryEntry[]>
  chunkAndIndex(content: string): Promise<Chunk[]>
}

C99 Primitives

size_t mind_chunk_end(const char* utf8, size_t max_bytes);
uint64_t mind_fnv1a64(const char* data, size_t len);
size_t mind_whitespace_token_estimate(const char* text);

Optional N-API binding to Node.js. Automatic fallback to TypeScript implementation when native module unavailable.

Current Status

Turn pipeline, memory persistence and FTS retrieval, multi-LLM backend adapters, and Web UI implemented. Vector search, message bus, and multi-ThinkingUnit parallelism under development.


Related Links


Last updated: 2026-05-13