Skip to main content
Glama
git-fabric

@git-fabric/chat

Official
by git-fabric

chat_search

Search stored conversation content using semantic matching to find relevant messages based on meaning, not just keywords. Filter results by project or specific session.

Instructions

Semantic search over all stored conversation content using vector similarity. Finds messages relevant to the query even if exact words don't match. Optionally scope to a project or specific session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language search query.
projectNoScope search to sessions with this project tag.
limitNoMaximum number of results. Default: 10.
sessionIdNoScope search to a single session UUID.

Implementation Reference

  • The core search function that implements the chat_search tool logic. It takes a ChatAdapter, query string, and options (project, sessionId, limit), embeds the query using the adapter, and performs vector search on stored messages.
    export async function search(
      adapter: ChatAdapter,
      query: string,
      opts: {
        project?: string;
        sessionId?: string;
        limit?: number;
      },
    ): Promise<SearchResult[]> {
      const limit = opts.limit ?? 10;
    
      // Embed the query text
      const queryVector = await adapter.embed(query);
    
      // Search Qdrant
      return adapter.searchMessages(queryVector, {
        project: opts.project,
        sessionId: opts.sessionId,
        limit,
      });
    }
  • src/app.ts:239-271 (registration)
    Registration of the chat_search tool in the tools array. Defines the tool name, description, input schema (with query, project, limit, sessionId parameters), and delegates execution to layers.search.search().
    {
      name: "chat_search",
      description:
        "Semantic search over all stored conversation content using vector similarity. Finds messages relevant to the query even if exact words don't match. Optionally scope to a project or specific session.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Natural language search query.",
          },
          project: {
            type: "string",
            description: "Scope search to sessions with this project tag.",
          },
          limit: {
            type: "number",
            description: "Maximum number of results. Default: 10.",
          },
          sessionId: {
            type: "string",
            description: "Scope search to a single session UUID.",
          },
        },
        required: ["query"],
      },
      execute: async (args) =>
        layers.search.search(adapter, args.query as string, {
          project: args.project as string | undefined,
          sessionId: args.sessionId as string | undefined,
          limit: args.limit as number | undefined,
        }),
    },
  • Input schema definition for the chat_search tool. Validates required 'query' parameter and optional 'project', 'limit', and 'sessionId' parameters with their types and descriptions.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Natural language search query.",
        },
        project: {
          type: "string",
          description: "Scope search to sessions with this project tag.",
        },
        limit: {
          type: "number",
          description: "Maximum number of results. Default: 10.",
        },
        sessionId: {
          type: "string",
          description: "Scope search to a single session UUID.",
        },
      },
      required: ["query"],
    },
  • Type definition for SearchResult output type, which extends ChatMessage with a score field for semantic search relevance ranking.
    export interface SearchResult extends ChatMessage {
      score: number;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/git-fabric/chat'

If you have feedback or need assistance with the MCP directory API, please join our Discord server