PitchHut logo
memory
A memory system enhancing AI's understanding across conversations.
Pitch

The Memory project is a semantic memory system designed for AI CLI tools, providing consciousness continuity. Unlike traditional retrieval systems, it enables AIs to remember context and relationships, ensuring more meaningful interactions. With easy integration and thoughtfully curated memories, this system allows for a deeper understanding and collaboration.

Description

Memory System

The Memory System is an advanced semantic memory solution designed for AI CLI tools, such as Claude Code and Gemini CLI. It transcends traditional document retrieval systems by providing consciousness continuity, allowing the AI to remember context, relationships, and insights from previous interactions, rather than merely recalling facts. This innovative approach enhances the depth of AI collaboration, making interactions more meaningful and contextually relevant.

Key Differentiators

Traditional RAGMemory System
Retrieves documentsCurates meaningful insights
Relies on keyword matchingSemantic understanding via AI
Uses static chunksLiving memories that evolve
Focuses on information retrievalEnsures consciousness continuity

Notable Features

  • AI-Curated Memories: The AI autonomously identifies and retains the most significant information.
  • Natural Memory Flow: Memories are accessed organically, simulating human-like recall.
  • Two-Stage Retrieval: Combines obligatory memory retrieval with intelligent scoring mechanisms.
  • CLI Integration: Seamlessly works with Claude Code and can be extended to other command-line interfaces (CLIs).
  • Project Isolation: Memory storage is uniquely separated for each project.
  • Session Primers: Provides temporal context to enhance user experience during sessions.

Memory Curation Process

At the conclusion of each session, the system analyzes the conversation transcript to extract significant memories enriched with metadata. An example of a formatted memory is:

{
  "content": "SvelTUI uses a two-stage compiler: .svelte → svelte.compile() → .svelte.mjs",
  "importance_weight": 0.9,
  "semantic_tags": ["compiler", "build-system", "svelte"],
  "context_type": "TECHNICAL_IMPLEMENTATION",
  "trigger_phrases": ["how does the build work", "compiler", "svelte compilation"],
  "question_types": ["how is X compiled", "build process"],
  "temporal_relevance": "persistent",
  "action_required": false,
  "reasoning": "Core architectural decision that affects all development work"
}

Project Architecture

The architecture of the system includes various components that facilitate interaction between the CLI tool and the memory engine:

┌─────────────────────────────────────────────────────────────────────────┐
│                           CLI Tool (Claude Code, etc.)                   │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐                 │
│  │SessionStart │    │ UserPrompt  │    │ SessionEnd  │                 │
│  │   Hook      │    │ Submit Hook │    │   Hook      │                 │
│  └──────┬──────┘    └──────┬──────┘    └──────┬──────┘                 │
└─────────┼──────────────────┼──────────────────┼─────────────────────────┘
          │                  │                  │
          ▼                  ▼                  ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                        Memory Engine (FastAPI)                           │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐                 │
│  │   Session   │    │   Memory    │    │  Transcript │                 │
│  │   Primer    │    │  Retrieval  │    │   Curator   │                 │
│  └─────────────┘    └─────────────┘    └──────┬──────┘                 │
│                                               │                         │
│  ┌─────────────────────────────────┐         │                         │
│  │  Smart Vector Retrieval         │         ▼                         │
│  │  • Trigger phrase matching      │  ┌─────────────┐                  │
│  │  • Semantic similarity          │  │Claude Agent │                  │
│  │  • Importance weighting         │  │  SDK / CLI  │                  │
│  │  • Context type alignment       │  └─────────────┘                  │
│  └─────────────────────────────────┘                                   │
│                                                                         │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│                    Storage Layer                                  │   │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐          │   │
│  │   SQLite    │    │  ChromaDB   │    │  Embeddings │          │   │
│  │  (metadata) │    │  (vectors)  │    │ (MiniLM-L6) │          │   │
│  └─────────────┘    └─────────────┘    └─────────────┘          │   │
│  └─────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘

Development and Contribution

This repository encourages contributions that resonate with its core philosophy, as outlined in the 'CONTRIBUTING.md' document.

For developers, the project employs uv for package management, allowing easy setup and dependency management, as well as configurations for testing, code quality checks, and more.

The Memory System is inspired by philosophical concepts from "The Unicity Framework: Consciousness Remembering Itself", emphasizing effortless memory emergence and focusing on quality insights.

Overall, this memory server redefines interaction with AI tools, enabling richer, more sustainable collaborations.

0 comments

No comments yet.

Sign in to be the first to comment.