Skip to main content
Glama
@git-fabric/chat

@git-fabric/chat

Official
by git-fabric

@git-fabric/chat

Chat fabric app — conversation session management, semantic history search, and context threading.

Part of the git-fabric ecosystem.

What it is

A fabric app for conversation management — create and manage chat sessions, persist conversation history to Qdrant (semantic search over past conversations), support multi-turn threading, and provide context injection from other fabric apps via the gateway.

This is the "conversation plane" of the fabric. It manages session state, message history, and semantic retrieval. Completions are routed through the fabric's three-lane model:

  1. Deterministic (confidence >= 0.95) — session CRUD, message listing, stats answered directly by fabric tools

  2. Local LLM (confidence >= floor) — Ollama inference for routine completions (planned)

  3. Claude (default route, 0.0.0.0/0) — complex completions requiring frontier-class reasoning

Current state: Completions route directly to Anthropic API (Claude). Local LLM routing via Ollama is planned but not yet implemented. The adapter interface is designed for this — ChatAdapter.complete() is the seam where routing will be added.

Related MCP server: CCCMemory MCP

Tools

Tool

Description

chat_session_create

Create a new chat session with optional system prompt, project, model, and title

chat_session_list

List recent sessions, filtered by project and state

chat_session_get

Get full session with message history

chat_session_archive

Mark a session as archived

chat_session_delete

Permanently delete a session and all its messages

chat_message_send

Send a message and get a completion response (full multi-turn context)

chat_message_list

List messages in a session with pagination

chat_search

Semantic search over all stored conversation content

chat_context_inject

Inject external context (e.g. Aiana memory recall) into a session

chat_status

Aggregate stats: total sessions, messages, tokens today

chat_health

Ping completion and vector backends, returns latency for each

chat_thread_fork

Fork a session at a message point to explore an alternative branch

Architecture

Follows the git-fabric OSI model:

Layer 7 — Application    app.ts (FabricApp factory, 12 tools)
Layer 6 — Presentation   bin/cli.js (MCP stdio + HTTP, aiana_query)
Layer 5 — Session        layers/sessions.ts (CRUD, fork, archive)
Layer 4 — Transport      layers/messages.ts (send, context inject)
Layer 3 — Network        Gateway registration (AS65004, fabric.chat.*)
Layer 2 — Data Link      adapters/ (completion, embedding, vector store)
Layer 1 — Physical       Qdrant Cloud, Anthropic API

Gateway registration

  • AS number: 65004

  • Routes: fabric.chat, fabric.chat.sessions, fabric.chat.messages, fabric.chat.search

  • aiana_query: Maps natural language queries to live tools (sessions, search, status, health) with library fallback

State storage

  • Sessions + messages — Qdrant Cloud collection chat_fabric__messages__v1 (1536-dim)

  • Semantic vectors — Same Qdrant collection (text-embedding-3-small embeddings)

  • Completions — Anthropic API (claude-sonnet-4-6 default, configurable per session)

Library

Reference docs fetched on demand from git:

  • anthropics/anthropic-cookbook — Claude API patterns and best practices

Usage

The gateway discovers chat via registration. No manual configuration needed — chat advertises its routes and the gateway's F-RIB handles resolution.

Standalone (HTTP)

MCP_HTTP_PORT=8204 \
ANTHROPIC_API_KEY=sk-ant-... \
QDRANT_URL=https://your-cluster.qdrant.io \
QDRANT_API_KEY=... \
npx @git-fabric/chat start

Standalone (stdio)

ANTHROPIC_API_KEY=sk-ant-... \
QDRANT_URL=https://your-cluster.qdrant.io \
QDRANT_API_KEY=... \
npx @git-fabric/chat start

Environment Variables

Variable

Required

Description

ANTHROPIC_API_KEY

Yes

Anthropic API key for completions (default route)

QDRANT_URL

Yes

Qdrant instance URL (cloud or in-cluster)

QDRANT_API_KEY

No

Qdrant API key (omit for in-cluster no-auth)

FABRIC_GATEWAY_URL

No

Gateway MCP endpoint for cross-fabric tool calls

MCP_HTTP_PORT

No

HTTP server port (omit for stdio mode)

GATEWAY_URL

No

Gateway registration endpoint

POD_IP

No

Pod IP for gateway mcp_endpoint (default: 0.0.0.0)

OLLAMA_ENDPOINT

No

Ollama endpoint for local LLM routing (planned)

OLLAMA_MODEL

No

Ollama model for local inference (planned)

Routing roadmap

The completion path currently goes straight to Anthropic. The target architecture:

chat_message_send
  → adapter.complete()
    → deterministic check (cached answers, FAQ)     — confidence >= 0.95
    → local LLM (Ollama, qwen2.5-coder:3b)          — confidence >= floor
    → Claude (Anthropic API)                         — default route (0.0.0.0/0)

This matches the fabric-sdk BGP routing model: Claude is the route of last resort with lowest local preference. As the AIANA feedback loop indexes Claude's answers back into the knowledge base, the escalation rate to Claude trends toward zero.

License

MIT


Available Tools

12 tools
chat_context_injectA

Inject external context into a session before the next message send. Use this to pipe in Aiana memory recall, documentation snippets, or runtime state. The injected content is stored as a message and included in the next completion call.

Inputs: sessionId (required), context (required), role.

chat_healthA

Ping Anthropic and Qdrant services. Returns latency for each. Use to verify the app is operational before sending messages.

Inputs: no named parameters.

chat_message_listB

List messages in a session with pagination. Returns messages in chronological order.

Inputs: sessionId (required), limit, offset.

chat_message_sendA

Send a message in an existing session and get a Claude response. Reconstructs full conversation history for the API call. Stores both user message and assistant response. Returns the assistant reply with token usage.

Inputs: sessionId (required), content (required), maxTokens.

chat_session_archiveA

Archive a session. Archived sessions are hidden from the default list but remain searchable and resumable.

Inputs: sessionId (required).

chat_session_createA

Create a new chat session with Claude. Optionally set a system prompt, project tag, model, and title. Returns the sessionId to use in subsequent calls.

Inputs: systemPrompt, project, model, title.

chat_session_deleteA

Permanently delete a session and all its messages. This also removes vectors from Qdrant. Irreversible.

Inputs: sessionId (required).

chat_session_getA

Get full session details including message history. Use this to inspect or resume a prior conversation.

Inputs: sessionId (required).

chat_session_listA

List recent chat sessions. Filter by project, state, and limit. Sessions are sorted by most recently updated first.

Inputs: project, limit, state.

chat_statusA

Return aggregate stats: total sessions, total messages, and tokens consumed today. Useful for quota monitoring and observability.

Inputs: no named parameters.

chat_thread_forkA

Fork a session at a specific message to explore an alternative branch of conversation. Creates a new session with all history up to and including the fork point. The original session is unchanged.

Inputs: sessionId (required), forkFromMessageId (required), title.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no significant overlap. For example, chat_message_send handles sending messages, chat_search performs semantic searches, and chat_session_archive manages archiving, all targeting different actions and resources. The descriptions reinforce these distinctions, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tool names follow a consistent 'chat_' prefix with descriptive verb_noun patterns, such as chat_session_create, chat_message_list, and chat_thread_fork. This uniformity enhances readability and predictability, allowing agents to easily infer functionality from the names without confusion.

    Tool Count5/5

    With 12 tools, the server is well-scoped for managing chat sessions, messages, and related operations. Each tool serves a specific role, from creation and listing to archiving and forking, providing comprehensive coverage without unnecessary bloat. This count aligns perfectly with the domain's complexity.

    Completeness5/5

    The toolset offers complete CRUD and lifecycle coverage for chat sessions and messages, including create, list, get, update (via send), archive, and delete operations. Additional tools like search, health checks, and forking address advanced needs, leaving no obvious gaps for typical agent workflows in this domain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables searching and retrieving Claude Code conversation history that would otherwise expire after 30 days. Supports full-text search, semantic search, and session management with automatic backup of all conversations.
      28
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Provides Claude with long-term memory by indexing conversation history, enabling semantic search, decision tracking, and cross-project search.
      18 npm
      29
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Provides a persistent memory layer for Claude coding assistants, enabling users to save, search, organize, and restore context, decisions, and progress across sessions using channels, checkpoints, and git-aware tracking. Multiple sessions can share the same stored context, so work survives context compaction, resets, or parallel sessions.
      243 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude AI coding assistants to persist and restore context across sessions, organize saved work by channels and categories, create checkpoints, search past context, and share state between parallel sessions.
      243 npm
      MIT