TCAM Memory System
Resilient 4-Layer Memory Architecture for TCAM v1.4 (Triadic Cognitive Augmentation Model)
Overview
The TCAM Memory System implements a fault-tolerant memory architecture where each layer operates independently, ensuring that system failures in one layer do not cascade to others. Memory operations are handled by a dedicated Memory Service running on Qwen 3.5 9B (local LLM).
Architecture
Four Independent Layers
- L1: Chronicle - Immutable historical record (file system, markdown)
- L2: Active Stream - Volatile working memory (Cloud LLM context + Redis)
- L3: Hive Mind - Semantic memory (Qdrant vector DB + Mem0)
- L4: Agent Codex - Personal knowledge base (file system, markdown)
Memory Service
Dedicated process running on Qwen 3.5 9B for:
- Truth extraction from dialogue
- Chronicle inscription
- Hive Mind indexing
- Agent Codex updates
- Sleeping cycle orchestration
Technology Stack
- TypeScript/Node.js - Core implementation
- Qwen 3.5 9B - Local LLM for memory operations
- Mem0 - Automatic fact extraction
- Qdrant - Vector database for semantic search
- Redis - Fast state persistence (LangGraph checkpointer)
- LangGraph - Multi-agent orchestration
- Jest - Testing framework
- fast-check - Property-based testing
Project Structure
.
├── src/ # Source code
├── tests/ # Test files
├── data/ # Chronicle storage
├── codex/ # Agent Codex (L4)
├── docs/ # Documentation
└── .kiro/specs/ # Specification documents
Getting Started
Prerequisites
- Node.js 18+
- Ollama (for Qwen 3.5 9B)
- Docker (for Qdrant and Redis)
Installation
# Install dependencies
npm install --legacy-peer-deps
# Pull Qwen 3.5 9B model
ollama pull qwen2.5:9b-instruct-q4_K_M
# Pull embedding model
ollama pull nomic-embed-text
# Start Qdrant (using setup script)
# Windows PowerShell:
.\scripts\setup-qdrant.ps1
# Linux/Mac:
bash scripts/setup-qdrant.sh
# Or manually with Docker:
docker run -d --name qdrant -p 6333:6333 -p 6334:6334 -v qdrant_storage:/qdrant/storage qdrant/qdrant
# Start Redis
docker run -d --name redis -p 6379:6379 redis
# Build and install globally
npm run build
npm install -g . --legacy-peer-deps
CLI Usage
# Interactive main menu
anots
# Real-time monitoring dashboard (Terminal UI)
anots dashboard
# Chat with Axiom (TCAM Node C)
anots axiom
# Start MCP server (19 tools for IDE integration)
anots mcp:start
# Start REST API server
anots api:start
# Start API with Axiom chat endpoint
anots api:start --axiom
# Search memory
anots memory:search "your query"
# Import conversation (JSON/Markdown)
anots import conversation.json --type general
# System status
anots status
# Configuration wizard
anots setup
# Show all commands
anots --help
Dashboard Features
The Terminal UI dashboard (anots dashboard) provides:
- Real-time memory layer health monitoring
- System statistics (chapters, sessions, memories)
- Activity log with timestamps
- Keyboard shortcuts (F1-F3, R, Q)
- Auto-refresh every 2 seconds
- Cyberpunk aesthetic with 90s BBS vibes
Verify Setup
# Check Qdrant
curl http://localhost:6333/health
# Check Redis
redis-cli ping
# Check Ollama
ollama list
Development
# Build
npm run build
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Lint
npm run lint
# Format code
npm run format
Importing Conversations
Import large conversation files into the ANOTS memory system:
# Import Ubik conversation
npm run import -- data/import/conversation.json --type ubik
# Import Axiom conversation
npm run import -- data/import/conversation.md --type axiom
# Preview import without writing (dry run)
npm run import -- data/import/conversation.json --dry-run
# Custom chunk size (messages per chapter)
npm run import -- data/import/large-file.json --type ubik --chunk-size 100
What Gets Imported
- Chronicle: Conversation history in chapters
- Hive Mind: Semantic indexing for search
- Codex: Extracted truths and insights
See data/import/README.md for detailed documentation and examples.
Specification
See .kiro/specs/memory-system/ for complete specification:
requirements.md- Functional requirementsdesign.md- Technical designtasks.md- Implementation tasks
License
MIT