# LoreConvo [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/labyrinth-analytics/loreconvo  
**GitHub Stars:** 12  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/loreconvo

## Description
Local-first persistent session memory for Claude Code and other agents. SQLite + FTS5, no cloud.

## Tools
Capabilities this server exposes over MCP:

- **save_session** — Save a session summary to persistent memory.

    Call this at the end of a session or when the user requests /bridge save.
    Captures decisions, artifacts, skills used, and open questions for recall
    in future sessions.

    Surface guidance: 'code' for Claude Code and other development tools (Codex, Cursor, Hermes).
    'chat' for Claude Chat. 'cowork' for legacy records only. For non-Claude clients: use
    surface='code' and external_surface=<vendor>.

    Args:
        title: Short descriptive title for the session
        surface: Where this session ran - 'code', 'chat', or 'cowork'.
        summary: 2-3 paragraph narrative summary of what happened. Capped at
            15000 chars.
        decisions: List of key decisions made during the session. Each item
            capped at 2000 chars.
        artifacts: List of files created or modified
        open_questions: Unresolved questions to carry forward. Each item
            capped at 2000 chars.
        tags: Freeform tags for categorization
        skills_used: Skills that were invoked during this session
        project: Project name if part of a defined project
        start_date: ISO 8601 start time (defaults to now)
        end_date: ISO 8601 end time
        session_id: Optional session ID to enable deduplication with the
            auto-save hook. If a session with this ID already exists (e.g.,
            auto-saved at session end), the record is updated with the richer
            manual metadata. Artifacts from the existing record are preserved
            when the caller does not supply artifacts. If omitted, a new UUID
            is generated (existing behavior).
        external_tool_session: Set True when saving a session generated by an
            external tool (e.g., Anthropic Managed Agents). Flagged sessions are
            excluded from auto-load and search by default to prevent context
            contamination. Override exclusion with include_external=True on search,
            or set LORECONVO_EXTERNAL_TOOL_EXCLUSION=0 to disable globally.
        reasoning_notes: Optional free-form text capturing the reasoning chain
            or thought process behind decisions. Blank or None leaves the
            field empty. Capped at 15000 chars.
        summarize: If True and LORECONVO_ANTHROPIC_API_KEY is set, send the summary to
            Claude API (Haiku) for compression before saving. Opt-in only;
            defaults to False. Falls back to the raw summary on any API error
            or if the key is absent. See INSTALL.md Privacy Note.
        lore_session_id: Use this parameter for remote-devices bridge clients (e.g.,
            Cowork). The bridge drops session_id, so use lore_session_id instead. If both
            session_id and lore_session_id are provided, they must match.
        external_session_id: The calling tool's own id for this conversation,
            if it exposes one. Lets LoreConvo find the conversation's
            transcript later. Read it from your environment when present:
            CODEX_THREAD_ID (Codex), CURSOR_CONVERSATION_ID (Cursor),
            HERMES_SESSION_ID (Hermes). Omit it if none is set.
        external_surface: Which tool that id belongs to: 'codex', 'cursor',
            'hermes', 'claude_code' or 'cowork'. Optional; identifies the
            vendor when saving sessions from external tools even without
            an external_session_id.
    
- **delete_session** — Delete a session by ID.

    Permanently removes a session from storage. Pinned sessions cannot be deleted
    and must be unpinned first with pin_session(keep_forever=False).

    Args:
        session_id: ID of the session to delete
        confirm: Must be True to proceed with deletion (safety confirmation)
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.

    Returns:
        {"status": "deleted", "session_id": "..."} on success
        {"status": "error", "error": "message"} on failure
    
- **update_session** — Update metadata fields on an existing session in place.

    Only fields you pass are changed; fields you omit keep their current
    values.  No new record is created.  Use this to correct a title,
    refine a summary, retag, or fix a wrong surface label without
    re-saving the entire session.

    Args:
        session_id: ID of the session to update (required)
        title: New title for the session
        summary: New summary text (replaces the existing summary)
        surface: New surface - 'code' (Claude Code, Codex, Cursor, Hermes), 'chat' (Claude Chat), or 'cowork' (legacy)
        project: New project name
        tags: New tag list (replaces existing tags)
        decisions: New decisions list (replaces existing decisions)
        artifacts: New artifacts list (replaces existing artifacts)
        open_questions: New open questions list (replaces existing)
        reasoning_notes: New reasoning notes text
        lore_session_id: Alias for session_id (remote-devices bridge).
            If both are provided, they must match.

    Returns:
        {"status": "updated", "session_id": "...", "title": "..."} on success
        {"status": "error", "error": "message"} on failure
    
- **get_recent_sessions** — Get recent session summaries.

    Use to see what work was done recently, optionally filtered by project or skill.

    Args:
        limit: Max sessions to return (default 10)
        days_back: How far back to look (default 30 days)
        project: Filter to sessions in this project
        skill: Filter to sessions that used this skill
        include_resolved: If True, open questions already answered (or marked
            wont-answer) via transition_memory_item are shown labelled
            "[resolved]" instead of hidden. Default False.
    
- **get_session** — Get full details of a specific session.

    Args:
        session_id: The UUID of the session to retrieve
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **search_sessions** — Search session memory by keyword, with optional filters.

    Use to find sessions where a topic was discussed, a decision was made,
    or a specific skill/project was involved.

    Args:
        query: Search keywords (matched against title, summary, decisions).
            Short alphabetic tokens (<=10 chars) are prefix-matched automatically.
            Append `*` to force prefix matching on longer terms (e.g., "consolid*").
        persona: Filter to sessions tagged with this persona (supports prefix matching)
        tags: Filter to sessions with any of these tags
        skills: Filter to sessions that used any of these skills
        project: Filter to sessions in this project
        limit: Max results (default 10)
        include_external: If True, include sessions flagged as external_tool_session.
            Default False. Can also be enabled globally via LORECONVO_EXTERNAL_TOOL_EXCLUSION=0.
        semantic: If True, use LanceDB hybrid (vector + BM25) search instead of FTS5.
            Pro tier only. Falls back to FTS5 if index not built yet; run
            rebuild_index to build it after first Pro activation.

            Semantic search is designed for topical discovery -- finding
            sessions about a concept even when exact keywords differ. For
            known-item lookup (you know specific words that appeared in a
            session), FTS5 (semantic=False) gives higher recall because it
            matches exact tokens. A probe over 7,500 sessions found FTS5
            recall at 9-10/10 vs semantic 1/10 for known-item queries,
            which is expected: BGE-small embeddings + RRF equal-weight
            fusion + recency decay all bias toward topical relevance over
            exact-match. Use semantic=True when you want "sessions about X";
            use semantic=False when you want "sessions containing word Y".
        include_expired: If True, include sessions whose expires_at is in the past.
            Default False (expired sessions are hidden from search).
        after: Optional ISO 8601 UTC instant (e.g. "2026-07-06T00:00:00Z"). Only
            sessions started at or after this instant are returned.
        before: Optional ISO 8601 UTC instant. Only sessions started strictly
            before this instant are returned.

            To answer a question like "what did I work on last week", resolve
            the range yourself -- you know the user's local date, the server
            does not -- and pass the two instants. Do not put date words in
            `query`; they are matched as literal keywords, not parsed.
        include_passages: Return up to three matching passages of stored
            conversation text per session. Default True.
    
- **get_context_for** — Get relevant session context for a topic.

    Use at the start of a session to load prior decisions and context about a topic.
    Returns the most relevant session excerpts.

    Args:
        topic: The topic to find context for (e.g., 'K-1 parser', 'rental insurance')
        max_results: Max excerpts to return (default 5)
        include_external: If True, include sessions flagged as external_tool_session.
            Default False.
        semantic: If True, use LanceDB hybrid search (Pro only). Falls back to FTS5
            if index not yet built.
        include_passages: Return up to three matching passages of stored
            conversation text per session. Default True.
        include_resolved: If True, open questions already answered (or marked
            wont-answer) via transition_memory_item are shown labelled
            "[resolved]" instead of hidden. Default False. Each result carries
            question_status 'applied' or 'unavailable'.
    
- **configure_agent_context** — Store or update a named topic configuration for an agent.

    Args:
        agent_name: Canonical agent name (^[a-z][a-z0-9-]{1,63}$).
        project: Project name matching sessions.project (^[a-z_][a-z0-9_]{0,63}$).
        topics: Non-empty list of topic strings; max 10; each max 200 chars.
            Replaces all existing topics for this (agent_name, project) pair.
        max_results_per_topic: Sessions returned per topic search. 1-10.
        enabled: Set False to disable injection without deleting the config.
        retire: Set True to soft-retire this config (status='retired').
            inject_agent_context treats a retired config like enabled=0.
            Any write with retire=False reactivates a previously retired
            config (reflected in the response's reactivated_retired_config).
    
- **inject_agent_context** — Return targeted session context within project for an agent at session start.

    If topics is provided (non-empty, len<=10), it overrides stored config.
    If topics is None, stored config is used.
    If topics=[], has_config reflects stored state; no injection runs.

    Returns status in {"ok", "partial", "warning", "error"}.
    Branch on status first; treat "warning" as skipped (not success), not
    as a synonym for "ok" -- a caller that only checks `status != "error"`
    will silently treat skipped or empty injection as success.
    
- **tag_session** — Tag a session with a persona for filtered recall.

    Supports hierarchical personas (e.g., 'ron-bot:sql' matches 'ron-bot' queries).

    Args:
        session_id: Session to tag
        persona_name: Persona identifier (e.g., 'ron-bot', 'ron-bot:sql', 'tax-prep')
        relevance_note: Optional note about why this session is relevant to the persona
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **link_sessions** — Link two related sessions.

    Args:
        from_id: Source session ID
        to_id: Target session ID
        link_type: Relationship type - 'continues', 'related', or 'supersedes'
    
- **get_related_sessions** — Find sessions related to a given session by co-occurrence and embedding. Pro only.

    Returns co-occurrence links (shared_term_count >= 1) and embedding-based
    semantic links (shared_term_count=0 sentinel). Co-occurrence results rank
    above embedding results when sorting by shared_term_count DESC.
    Response version=2 signals the new format with link_type field.

    Args:
        session_id: UUID of the session to find related sessions for
        limit: Max results to return (default 10, max 50)
        min_shared_terms: Minimum shared keywords required (default 3)
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **graph_session_map** — Render a Mermaid knowledge-graph neighborhood around a session or project.

    Exactly one of session_id/project selects the seed. Traversal is a
    bounded, read-only BFS over session_links (undirected) plus each
    admitted session's attribute leaves (project/skill/persona/tag). Pro
    tier adds derived (co-occurrence/embedding) and doc (LoreDocs
    cross-link) edges, seed-only. Every emitted label is restricted to a
    fixed character allowlist so no title/tag/skill text can alter the
    diagram's structure.

    Args:
        session_id: UUID of the seed session. Exactly one of session_id/project required.
        project: name of the seed project. Exactly one of session_id/project required.
        depth: number of BFS expansion hops over link edges, clamped [0, 3]
        max_nodes: node budget (sessions + attribute leaves), clamped [1, 200]
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.

    Returns a dict with version, seed, seed_found, mermaid, nodes, edges,
    truncated, nodes_emitted, nodes_available, edges_emitted,
    nodes_dropped_by_kind, edges_dropped_by_kind, frontier_session_ids,
    edge_kinds_included, edge_kinds_omitted -- or {"error": {...}} on a
    validation failure or an unavailable database.
    
- **rebuild_index** — Rebuild the LanceDB semantic search index from all stored sessions. Pro only.

    Starts the rebuild in a background thread and returns immediately with a
    status handle.  The server remains responsive to other calls while the
    rebuild runs.  Call rebuild_index_status() to track progress.

    The first run downloads BAAI/bge-small-en-v1.5 (~130MB; cached afterwards).
    Expect roughly 3-10 minutes per thousand sessions depending on hardware.

    A rebuild already in progress returns status 'busy' with the current
    progress percentage.

    Returns:
      - {'status': 'started', 'message': '...'}  when a new rebuild begins
      - {'status': 'busy', 'message': '...', 'progress_pct': N}  when one is
        already running
      - {'error': '...'}  when the tier is Free
    
- **rebuild_index_status** — Return the current status of a background semantic-index rebuild.

    Call after rebuild_index() to monitor progress.  Returns 'idle' when
    no rebuild has been started or the last rebuild has finished.

    Returns:
      - {'status': 'idle', 'message': '...'}
      - {'status': 'running', 'phase': '...', 'progress': N, 'total': N,
         'progress_pct': N, 'elapsed_s': N.N}
      - {'status': 'complete', 'message': '...', 'indexed': N,
         'total_in_db': N, 'exclusions': {reason: count}, 'elapsed_s': N.N}
      - {'status': 'error', 'message': '...'}
    
- **get_project** — Get project details including recent sessions and skill usage stats.

    Args:
        project_name: The project identifier
    
- **list_projects** — List all defined projects with session counts.
- **create_project** — Create or update a project definition.

    Projects group related sessions and can auto-associate based on skill usage.
    All changes to project instructions are logged for audit purposes.

    Args:
        name: Project identifier (e.g., 'secret-agent-man', 'project-ron')
        description: What this project is about
        expected_skills: Skills typically used in this project's sessions
        default_persona: Auto-tag new sessions with this persona
        instructions: Optional project-wide instructions or constraints
        session_id: Optional session ID for audit trail (typically provided by MCP context)
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **loreconvo_onboard** — Set up or update your LoreConvo workspace configuration.

    Call this once after installing LoreConvo to get a recommended setup.
    Call again any time to add projects or agents, or to regenerate your
    reference doc.

    Creates:
    - Project registrations for each project listed
    - A config file at ~/.loreconvo/onboard_config.json
    - A reference doc (markdown) in the response -- paste it into your
      CLAUDE.md or a LoreDocs vault so your AI assistant can apply your
      conventions consistently

    Args:
        name: Your workspace or team name (e.g. 'Labyrinth Analytics')
        projects: Snake_case project identifiers (e.g. ['side_hustle', 'finance'])
        agents: Agent names that will tag sessions (e.g. ['ron', 'meg'])
        tag_style: 'simple' (status + priority) or 'detailed' (adds effort,
                   scout-run markers, date tag guidance)

    Surfaces: code (Claude Code, Codex, Cursor, Hermes), cowork (Claude.ai
    Projects), chat (Claude.ai chat). Use external_surface to identify the
    originating tool when saving sessions from external tools.
    Agent identity: use tags=['agent:name'] -- not the surface field.
    
- **get_skill_history** — Get all sessions that used a specific skill.

    Useful for understanding how often a skill is used and in what contexts.

    Args:
        skill_name: The skill to look up (e.g., 'rental-property-accounting')
        days_back: How far back to search (default 90 days)
    
- **vault_suggest** — Get proactive context suggestions based on your session history.

    Analyzes recent sessions and surfaces:
    - Sessions with unresolved open questions that need follow-up
    - Sessions with key decisions worth reviewing before starting new work
    - Skill gaps: skills expected by a project but not used recently

    Use at the start of a session to find the most valuable prior context,
    or when you're unsure what to work on next.

    When `project` is given and the initial window returns no suggestions but
    the project still has sessions, the window is expanded progressively
    (30, 90, 365, then all-time days) so older unresolved work is surfaced
    instead of returning an empty result. The response metadata reports the
    effective window (`days_back`), and -- when the window was expanded --
    `window_expanded`, `expanded_to_days`, `initial_days_back`, and an
    `expansion_note`. An empty result with `project` set therefore means the
    project genuinely has no suggestions (no open questions, no >=2-decision
    sessions, no skill gaps) at any window, not merely that the default
    window was too narrow.

    Args:
        project: Filter suggestions to this project
        persona: Filter to sessions tagged with this persona (prefix matching)
        days_back: How far back to look (default 14 days)
        limit: Max suggestions to return (default 5)
    
- **get_tier** — Return the current LoreConvo license tier and status.

    Use this to confirm whether the Pro license key is loaded and valid.

    Returns a dict with keys:
        is_pro      -- bool, True if Pro tier is active
        mode        -- "licensed" | "dev_bypass" | "free" | "invalid_key"
        product     -- product name from the license payload (if licensed)
        exp         -- expiry date or "never" (if licensed)
        email       -- customer email (if licensed and present)
        error       -- error message (if mode is "invalid_key")
        upgrade_url -- Stripe checkout link (present when not already Pro)
    
- **vault_set_tier** — Activate a tier (free or pro) for LoreConvo.

    Pro tier removes the free-tier session limit (default: 50 sessions).
    After purchasing a Pro license, set LORECONVO_PRO=<your-license-key> in
    your environment and restart the server, then call this tool with tier='pro'
    to confirm Pro is active. Reverting to tier='free' re-enables limits (existing
    sessions are preserved -- only new saves are blocked once the limit is hit).
    
- **export_sessions** — Export portable session records to JSON or JSONL for migration.

    Exports matching session fields, skills, tags, and artifacts. Links and
    independent structured memory items are outside this export. Use
    output_path to write to a file; omit it to receive the data inline. Use
    import_sessions to load the exported file.

    Args:
        output_path: File path to write export (e.g. '/tmp/loreconvo_export.json').
                     If omitted, data is returned inline.
        project: Export only sessions from this project.
        tags: Export only sessions that have any of these tags.
        days_back: Limit to sessions from the last N days. Omit for all time.
        limit: Max sessions to export (default 1000).
        format: 'json' (array wrapped in metadata) or 'jsonl' (one session per line).
    
- **export_for_anthropic** — Export LoreConvo sessions to Anthropic managed-agents memory format. Pro only.

    Produces a JSON file in 'anthropic-memory-v1' format, suitable for import into
    Anthropic managed-agents memory stores. Only non-periodic, non-file-memory sessions
    are exported (contamination control).

    Each entry includes 'path' and 'content' matching the Anthropic Managed Agents
    memory create API (POST /v1/memory_stores/{id}/memories, beta header
    agent-memory-2026-07-22). A consumer script iterates entries and calls the
    create API per entry. Tags and metadata are supplementary fields not accepted
    by the API; embed them in content if needed.

    Args:
        output_path: File path to write the export. If omitted, data is returned inline.
        project: Export only sessions from this project.
        session_ids: List of specific session UUIDs to export. Overrides project filter.
        days_back: Limit to sessions from the last N days.
        lore_session_ids: Alias for session_ids (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **import_sessions** — Import sessions from a LoreConvo export file (JSON or JSONL).

    Reads an export created by export_sessions and saves sessions into the
    local database. Session UUIDs are preserved so re-importing is safe.

    Args:
        file_path: Path to the export file (JSON or JSONL format).
        on_conflict: What to do if a session ID already exists.
                     'skip' (default) -- leave the existing session unchanged.
                     'replace' -- overwrite with the imported version.
        dry_run: If True, parse and validate the file but make no DB changes.
    
- **inspect_sessions** — Inspect stored sessions: list, filter, or get full detail for one session.

    Answers 'what do you know about me?' and helps users find, browse, and
    understand their stored session memory.

    Args:
        session_id: If provided, return full detail for this specific session.
        search: Full-text search query across title, summary, decisions, tags.
        tag: Filter by tag substring (e.g. 'agent:ron', 'side_hustle').
        surface: Filter by surface ('code', 'cowork', 'chat').
        since: Return sessions on or after this date (YYYY-MM-DD).
        limit: Max sessions to return (default 20).
        show_stats: If True, include aggregate counts (total, by_surface, by_project).
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **get_stats** — Return a usage dashboard: session counts by surface, project, and tag;
    storage metrics (DB size, estimated tokens stored); and the 5 most recent
    sessions. Pro tier also includes ``semantic_index`` with session counts
    for the LanceDB semantic search index.

    Provides visibility into your memory usage -- who saved what, how much is
    stored, and what's been captured most recently. Includes
    hook_saves_failing status.
    
- **get_retrieval_health** — Read-only retrieval health check on YOUR store: index sync plus a
    self-retrieval probe (does search find a saved session by 3 distinctive
    terms from its own summary, in the top 3?), per search arm.

    Free: index health and the keyword (FTS5) probe. Pro: the semantic arm,
    only when ``include_semantic=true`` (loads the model; may be slow).
    Not an answer-quality or paraphrase-recall measure. Pass the echoed
    ``seed`` to repeat a sample. Bounded by a 60 s deadline; one run at a time.
    Nothing is written. ``project`` omitted means the whole store.
    
- **consolidate_memories** — Run memory consolidation for a project to build a structured digest.

    Analyzes recent SESSIONS and extracts decisions, open questions, and tech
    stack facts. Free tier: up to 3 consolidations per day. Pro: unlimited.

    Returns a digest dict with status, decisions found, open questions, and
    the formatted digest_markdown for reference.

    Acquires an exclusive lock; returns status='lock_held' if another
    consolidation is already running.

    Note: This consolidation analyzes SESSIONS ONLY. Structured memory items
    (decisions, questions, artifacts saved via save_memory_item) are a separate
    feature -- use query_memory_items to retrieve them. Users often query both
    digest and memory items together for complete recall.

    Args:
        project: Project name (matches the --project tag used when saving sessions)
        surface: Surface to consolidate ('code', 'cowork', 'chat', etc.) or None for all
        max_sessions: Maximum number of recent sessions to analyze (default 50)
        mode: 'heuristic' (the only available mode, default). Any other
            value, including 'llm', returns status='mode_unavailable' and
            runs nothing.
        dedup: Semantic dedup pass mode: 'off' (default), 'conservative', or
            'balanced'. When 'off' (or unset, or unrecognised), the pass does
            not run and consolidation behaves exactly as before. 'conservative'
            collapses near-verbatim restatements (cosine > 0.97); 'balanced'
            collapses paraphrases (cosine > 0.95). Can also be set via the
            LORECONVO_CONSOLIDATION_DEDUP environment variable; an explicit
            argument always overrides the env var.
    
- **get_memory_digest** — Retrieve the current memory digest for a project (built from sessions) without re-running consolidation.

    Returns None if no digest exists. Use consolidate_memories first to generate one.

    Optionally set disable=True to suppress auto-load injection for this digest,
    or disable=False to re-enable injection. Omit disable to just read the current state.

    Note: This retrieves the SESSION-BASED digest only. Structured memory items
    (decisions, open questions, artifacts saved via save_memory_item) are separate --
    use query_memory_items to retrieve them. Users often query both digest and
    memory items together for complete recall.

    Args:
        project: Project name
        surface: Surface filter (or None for all)
        disable: If provided, update the disabled flag on the digest
        max_tokens: Truncate digest_markdown to this estimated token limit (len // 4).
                    Default 2000. If truncated, appends [TRUNCATED] marker.
    
- **set_session_expiry** — Set or clear an expiry date on a session.

    After expires_at passes, the session is excluded from search_sessions,
    get_recent_sessions, and the auto-load hook. The session is NOT deleted --
    recover it with search_sessions(include_expired=True).
    Pass expires_at=None to clear a previously set expiry.

    Args:
        session_id: ID of the session to update
        expires_at: ISO 8601 date string (e.g. '2027-01-01T00:00:00Z'), or None to clear
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **get_dream_log** — Return recent consolidation log entries for transparency and diagnostics.

    Each entry shows: timestamp, project, surface, mode, source_count, trigger.
    Use this to confirm consolidation ran, check rate limit status, and diagnose
    fallbacks (e.g. api_key_found=false for LLM-mode fallback).

    Args:
        project: Filter by project (or None for all projects)
        surface: Filter by surface (or None for all)
        limit: Maximum number of entries to return (default 10, newest first)
    
- **get_docs_for_session** — Return LoreDocs documents cross-linked to a LoreConvo session. Pro tier only.

    Queries the LoreDocs cross_product_links table. Both LoreConvo and LoreDocs
    must be installed. Returns an empty list for free-tier callers (not an error).

    Manual links (link_type='manual') are always sorted first. Auto-links created
    with a stale embedding model are marked with is_stale=True and include an
    upgrade_message.

    Args:
        session_id  -- LoreConvo session UUID
        limit       -- max results (default 5)
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.

    Returns dict with:
        schema_version          -- int, for version negotiation by callers
        cross_product_available -- bool
        tier_gate               -- "satisfied" | "pro_required"
        links                   -- list of link dicts
        reason                  -- set when cross_product_available is False
    
- **session_link_doc** — Create a manual cross-product link from a LoreConvo session to a LoreDocs doc.

    Manual links are accessible on all tiers. The target doc must not be in a
    vault with cross_link_opt_out enabled. Both products must be installed.

    Args:
        session_id  -- LoreConvo session UUID
        doc_id      -- LoreDocs document ID
        vault_id    -- LoreDocs vault containing the document
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.

    Returns dict with:
        ok          -- bool
        session_id, doc_id, link_status on success
        link_status -- "created" | "upgraded_from_auto" | "already_manual" | "noop_auto"
        reason      -- failure description on error. Specific since SH-100670:
                   "LoreDocs not installed" | "LoreDocs installed but
                   unreachable: <detail>" | "LoreDocs schema too old: <detail>"
                   | "vault not found" | "vault has cross-linking disabled"
                   | "document not found"
    
- **get_server_info** — Return MCP compatibility status for this LoreConvo server.

    Returns product version, installed mcp SDK version, tested version, and
    compatibility status. Useful for diagnosing version mismatches on running
    servers without requiring a restart.

    Returns dict with: product_name, product_version, install_kind (wheel|editable),
    version_from_source (if editable), mcp_installed, mcp_tested, mcp_accepted,
    status (ok|mismatch|undetermined|disabled|internal_error), note,
    error_detail (set only on internal_error), hook_saves_failing.
    
- **get_anti_patterns** — Retrieve sessions marked as anti-patterns.

    Delegates to SessionDatabase.get_anti_patterns (SH-102688) so the
    MCP server, fallback script, and CLI all share one implementation.

    Returns a list of dicts with a 'truncated' boolean. Use at session start
    or before attempting a known-tricky approach to surface past failures.

    Args:
        topic: Optional keyword to filter within anti-patterns. Omit for all
               anti-patterns ordered by recency. When provided, uses FTS5 with
               a fan-out heuristic; result may be truncated if anti-patterns are
               sparse in the corpus.
        limit: Max results to return (1-100). Defaults to 10.
        project: Restrict to a specific project slug. Case-sensitive.
    
- **tag_as_anti_pattern** — Mark an existing session as an anti-pattern. Idempotent.

    Args:
        session_id: The sessions.id value to mark (TEXT <= 255 chars).
        source: Attribution for this tag (e.g., 'claude-code', 'agent:gina').
        reason: Human-readable reason for the tag. Stored in audit log.
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **untag_anti_pattern** — Remove an anti-pattern tag from a session. Idempotent.

    The audit log row is written on successful removal; not written if the
    session was not tagged (idempotent no-op case).

    Args:
        session_id: The sessions.id value to untag (TEXT <= 255 chars).
        source: Attribution for this untag (e.g., 'claude-code', 'admin').
        reason: Human-readable reason for the removal. Stored in audit log.
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **pin_session** — Pin or unpin a session to exclude it from automated cleanup.

    keep_forever=True (default): session excluded from future cleanup;
      any existing expires_at is cleared atomically.
    keep_forever=False: pin removed; session can receive expiry again.

    Args:
        session_id: The session ID to pin or unpin.
        keep_forever: True to pin, False to unpin.
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.

    Returns:
        {"ok": True, "session_id": "...", "keep_forever": bool}
        {"ok": False, "code": "invalid_session_id", "message": "..."}
        {"ok": False, "code": "invalid_param", "message": "..."}
        {"ok": False, "code": "session_not_found", "message": "..."}
        {"ok": False, "code": "db_error", "message": "..."}
        {"ok": False, "code": "feature_disabled", "message": "..."}
    
- **save_memory_item** — Save a structured memory item: a decision, open question, or artifact.

    Replaces the old free-text decisions/open_questions/artifacts lists on
    sessions with queryable, lifecycle-tracked rows. Idempotent when
    external_id is given: a second save with the same (project, external_id)
    returns the existing item (created=False) instead of creating a duplicate.

    Args:
        item_type: One of 'decision', 'open_question', 'artifact'.
        title: The decision text, the question text, or the artifact identifier.
            Capped at 4096 chars.
        body: Free-text detail/rationale for decision/open_question. Ignored
            for artifacts -- use artifact_type instead. Capped at 4096 chars.
        session_id: Originating session, if any. Must reference an existing session.
        project: Project namespace (default 'unspecified').
        tags: Freeform tag list.
        metadata: Freeform key-value metadata (mainly for artifacts).
        external_id: Caller-supplied dedup key, unique per (project, external_id).
        artifact_type: For item_type='artifact', the artifact's type (e.g. 'file', 'url').
        lore_session_id: Alias for session_id (for remote-devices bridge compatibility).
            If both are provided, they must match.
    
- **query_memory_items** — Query structured memory items by type, project, status, and recency.

    Args:
        item_type: Filter to 'decision', 'open_question', or 'artifact'.
        project: Filter to a project namespace.
        status: Filter to a lifecycle status (e.g. 'active', 'open', 'retired').
        artifact_type: Filter artifacts by their artifact_type. Only applies
            with item_type='artifact'.
        days: Only items created in the last N days.
        limit: Max rows to return (default 50, max 200).
        older_than_days: Only items created at least N days ago (e.g. stale
            open questions: item_type='open_question', status='open').
    
- **transition_memory_item** — Move a memory item through its lifecycle.

    Valid transitions: 'retire' (decision -> retired); 'answer' and
    'wont-answer' (open_question -> answered / wont-answer). Already-closed
    items return code='already_closed' so callers can retry idempotently.

    Args:
        item_id: The memory item's id.
        transition: 'retire', 'answer', or 'wont-answer'.
        reason: Optional free-text reason recorded on close.
        closing_session_id: Session performing the transition, if any. Must
            reference an existing session.
    
- **update_memory_item** — Correct a memory item's title, body, tags, or metadata, or move it between projects.

    Moving projects requires allow_project_change=True as an explicit guard
    against accidental cross-project moves. If the item has an external_id,
    the move is rejected with code='external_id_conflict' when the
    destination project already has an item with that external_id.

    Args:
        item_id: The memory item's id.
        title: New title, if changing.
        body: New body, if changing. Capped at 4096 chars.
        tags: New tag list, if changing (replaces, not merges).
        metadata: New metadata dict, if changing (replaces, not merges).
        new_project: Destination project, if moving.
        allow_project_change: Must be True to actually move projects.
    
- **configure_tools** — List or set enabled MCP tool groups.

    Called with no arguments: lists every group name, its tool count, and
    whether it is currently enabled.

    Called with a list of group names: validates and persists the selection
    to config.json.  The change takes effect on server restart -- already-
    connected clients may continue to see removed tools in their cached schema
    until they reconnect, and calls to a removed tool after restart return a
    standard 'unknown tool' protocol error.

    If the LORECONVO_TOOL_GROUPS environment variable is set, this tool
    returns an error instead of writing (the env var overrides config).
    

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "loreconvo": {
    "command": "uvx",
    "args": ["--from","loreconvo[server]","loreconvo"]
  }
}
```

## Documentation

## What LoreConvo does

LoreConvo provides a local memory layer for AI-assisted work. It records session summaries, decisions, artifacts, open questions, tags, skills, projects, surfaces, and optional reasoning notes. Sessions are stored in `~/.loreconvo/sessions.db`, giving users a database they can back up or remove directly.

The memory model separates episodic information, such as what happened in a session, from longer-lived conclusions and project context. Search can inspect titles, summaries, decisions, tags, and—when conversation capture is enabled for supported sessions—the stored user and assistant text. Claude Code hook-captured sessions can retain conversation text locally, while manually saved sessions from Chat, Codex, Cursor, or Hermes are summary-only.

## How it works

Sessions can be saved explicitly with `save_session` or captured automatically through optional Claude Code hooks. The session-end hook writes structured records, while the session-start hook selects relevant prior context for injection. `get_context_for` and `inject_agent_context` support more targeted loading based on a topic or configured agent and project settings.

FTS5 handles the default keyword search. Short alphabetic terms are prefix-matched automatically, and longer terms can request prefix matching with `*`. Searches can be narrowed by project, persona, tags, skills, date range, or expiration state. Pro users can build a LanceDB index and request hybrid semantic search for topical discovery; exact keyword lookup is better suited to the default FTS5 mode.

Projects, personas, links, and session attributes provide additional organization. Related sessions and Mermaid graph neighborhoods are available through Pro features. Consolidation can produce a project digest containing decisions, open questions, and technology facts from recent sessions.

## Setup and configuration

The repository can be installed with:

```bash
bash install.sh
```

The installer creates a virtual environment, installs dependencies, and checks the installation. The package can also be launched with `uvx --from loreconvo[server] loreconvo`.

Claude Code can load the source directory with `claude --plugin-dir /path/to/loreconvo`, or add it from an existing session with `/plugin add /path/to/loreconvo`. Cursor, Codex, and Hermes use their respective MCP configuration files. Cowork can load the plugin, but its sandbox may need access to `~/.loreconvo` to share the database with Claude Code.

Optional summarization is disabled by default. It can use a configured Anthropic API key, an OpenAI-compatible endpoint, or a local Ollama model, depending on the provider settings. The `summarize` option on `save_session` requests compression before storage. Conversation-text capture can be disabled with `LORECONVO_VERBATIM_CAPTURE=0`.

## Tools and capabilities

- Save, retrieve, inspect, search, tag, link, expire, export, import, and analyze sessions.
- Load recent or topic-specific context for a new session or configured agent.
- Create projects and review project activity, skill history, usage statistics, and memory digests.
- Suggest follow-up work from unresolved questions, decisions, and project skill gaps.
- Rebuild and monitor a Pro semantic index, find related sessions, and render bounded Mermaid graph neighborhoods.
- Configure free or Pro tier status and export records for Anthropic managed-agent memory formats.

## Limitations and notes

The free tier has a default limit of 50 sessions, and free-tier consolidation is limited to three runs per day. Pro-only capabilities include semantic search, related-session discovery, graph additions, Anthropic managed-agent export, and unlimited storage beyond the free-tier limit.

Conversation capture applies to Claude Code hook sessions and Cowork backfills. Stored conversation text excludes tool calls, tool results, shell or slash-command output, assistant reasoning, and system reminders. Known secret patterns are redacted before storage, but pattern matching cannot identify every sensitive value. Conversation text is not included in team, import/export, or Anthropic exports.

Claude Chat does not support plugins. The supplied `export-to-chat.sh` bridge copies a recent or searched session to the clipboard for pasting into Chat. External-tool sessions are excluded from search and automatic loading by default and can be included explicitly.

_Full upstream README: https://allmcps.com/mcp/loreconvo/readme_

