HC

haustorium12/continuity-v2

Database management

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

36 stars 8 forks 품질 68 트렌드 16MIT

Claude Code에 대한 장기 기억. SQLite+FTS5로 각 세션을 인덱스로, MCP를 통해 리콜을 노출하고, PreCompact/PostCompact Hook을 발송하기 때문에 아무것도 잃지 않습니다.

개요

JSONL 세션 레코드에 내장된 Claude Code의 장기 메모리 레이어. 연속성 (v1) 단일 세션 내에서 컴팩트에 대한 보호 - PreCompact Hook은 체크 포인트를 저장, SessionStart Hook은 다시 주사, 70/85/95% 토큰 압력에서 SSE 프록시 링 종. 모든 클로드 코드 세션은 이미 JSONL으로 디스크에 기록됩니다. - 모든 차례, 모든 도구 호출, 모든 응답. 일반 텍스트. 계정 관리 무료. 그 파일은 평범한 시력에 숨겨져있는 episodic 메모리 저장소입니다. v2는 인덱스, 검색 및 검색 레이어입니다. Walk ~/.claude/projects/는, FTS5를 가진 SQLite로 각 회전을 추출합니다: 모든 대화를 통해 전체 텍스트 검색은 Claude Code를 가지고있었습니다. 프로젝트, 역 동기화에 의해 필터링. 기존의 claude-memory MCP (포트 8200) 또는 혼자 서에 그것을 타십시오.

개요(AI 번역)

JSONL 세션 레코드에 내장된 Claude Code의 장기 메모리 레이어.

이것은 무엇인가?

continuity (v1) 컴팩트에 대한 보호 *within * 단일 세션 - PreCompact 후크 체크 포인트를 저장, SessionStart 후크가 다시 주사, 70/85/95% 토큰 압력 SSE 프록시 링 종.

continuity v2는 다른 절반을 해결합니다: across-session recall.

모든 클로드 코드 세션은 이미 JSONL으로 디스크에 기록됩니다. - 모든 차례, 모든 도구 호출, 모든 응답. 일반 텍스트. 계정 관리 무료.

그 파일은 평범한 시력에 숨겨져있는 episodic 메모리 저장소입니다. v2는 인덱스, 검색 및 검색 레이어입니다.

건축

단계 구축

1 단계 — 인덱스 (MVP)

Walk ~/.claude/projects/, FTS5로 SQLite로 각 차례 추출:

모든 대화를 통해 전체 텍스트 검색은 Claude Code를 가지고있었습니다. 프로젝트, 역 동기화에 의해 필터링.

단계 2 - MCP 도구

기존 claude-memory MCP (포트 8200) 또는 단독으로 연결하십시오.

  • search_sessions(query, limit=10) - FTS5 검색, 일치하는 회전 + 세션 ID + 주변 상황
  • recall_session(session_id, range="full") - 전체 또는 슬라이딩 세션 반환

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

continuity v2

Long-term memory layer for Claude Code, built on the JSONL session record.

What this is

continuity (v1) protected against compaction within a single session — PreCompact hook saves a checkpoint, SessionStart hook injects it back, SSE proxy rings bells at 70/85/95% token pressure.

continuity v2 solves the other half: across-session recall.

Every Claude Code session is already written to disk as a JSONL — every turn, every tool call, every response. Plain text. Append-only. Free.

That file is an episodic memory store hiding in plain sight. v2 is the index, search, and retrieval layer on top of it.

Architecture

~/.claude/projects//.jsonl   (raw episodic record, already there)
                       ↓
                   v2 indexer
                       ↓
              SQLite + FTS5 + (later) embeddings
                       ↓
                  MCP tool surface
                       ↓
        Claude calls search_sessions(query) mid-conversation

Build stages

Stage 1 — Index (MVP)

Walk ~/.claude/projects/, extract every turn into SQLite with FTS5:

sessions(id, project, started_at, ended_at, turn_count)
turns(session_id, turn_idx, ts, role, text)
turns_fts (FTS5 mirror of turns.text)

Literal full-text search across every conversation ever had with Claude Code. Filterable by project, reverse-chronological.

Stage 2 — MCP tool

Wire it into the existing claude-memory MCP (port 8200) or stand alone.

  • search_sessions(query, limit=10) — FTS5 search, returns matching turns + session ID + surrounding context
  • recall_session(session_id, range="full") — return full or sliced session
  • recent_sessions(n=10) — list recent sessions with first/last user message

Stage 3 — Semantic recall

Sentence embeddings + SIMILAR_TO edges. Hybrid search: literal + semantic.

For when the words don’t match but the concept does (“when did we talk about the thread-home problem” should match conversations about “Hal”, “50 First Dates”, “Alice in Wonderland”).

find_similar(query, limit=10) — find semantically similar turns via ANN search over all-MiniLM-L6-v2 embeddings, re-ranked by a hybrid score:

score = 0.7 * semantic_similarity
      + 0.2 * recency_decay       # linear, full decay at 365 days
      + 0.1 * complexity_bonus    # session turn count, normalized to 50 turns

Build: python embed.py (idempotent — skips turns already embedded), then python wire_similar.py to wire SIMILAR_TO edges between turn pairs with cosine ≥ 0.85.

Stage 4 — Auto-tagging (later)

  • Project mentions (saranna, dream-module, gold-402, etc.)
  • Decision markers (DECIDED, SAVE, session-close triggers)
  • File paths touched

Why this matters

GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

"mcpServers": { "continuity-v2": { "type": "stdio", "command": "python", "args": ["/path/to/continuity-v2/mcp_server.py"], "env": { "PYTHONIOENCODING": "utf-8" } } }