🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

@composio/embeddings

Package Overview
Dependencies
Maintainers
9
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@composio/embeddings

TurboPuffer schema definition for the Composio tool lookup system.

latest
npmnpm
Version
0.0.16
Version published
Weekly downloads
578
16.06%
Maintainers
9
Weekly downloads
 
Created
Source

@composio/embeddings

TurboPuffer schema definition for the Composio tool lookup system.

Overview

This package defines the TurboPuffer schema for storing and searching tools using:

  • Vector embeddings: 3072-dimensional vectors from OpenAI text-embedding-3-large
  • BM25 full-text search: On formatted tool descriptions
  • Filterable attributes: Toolkit names, tool names, display names

All types extend the official @turbopuffer/turbopuffer SDK types.

Exports

  • TOOL_SCHEMA: TurboPuffer schema configuration using AttributeSchema type
  • TOOL_DISTANCE_METRIC: Distance metric for vector similarity (cosine_distance)
  • ToolDocumentSchema: TypeScript type for tool documents
  • ToolRow: Query result type extending TurboPuffer's Row

Re-exported TurboPuffer Types

  • Row, Vector, DistanceMetric
  • AttributeSchema, AttributeSchemaConfig
  • NamespaceQueryParams, NamespaceQueryResponse
  • NamespaceWriteParams, NamespaceWriteResponse
  • Turbopuffer client

Tool Document Schema

TOOL_SCHEMA is the single source of truth. All TypeScript types are derived from it.

import type { ToolDocumentSchema } from '@composio/embeddings'
import { TOOL_SCHEMA } from '@composio/embeddings'

// Schema definition (source of truth)
TOOL_SCHEMA = {
  text: { type: 'string', full_text_search: true },
  tool_name: { type: 'string', filterable: true },
  display_name: { type: 'string', filterable: true },
  description: { type: 'string' },
  toolkit_name: { type: 'string', filterable: true },
  created_at: { type: 'string' },
}

// TypeScript type (automatically derived from TOOL_SCHEMA)
type ToolDocumentSchema = {
  id: string // Random 10-char identifier
  vector: Vector // 3072-dimensional embedding
  text: string // Formatted text (BM25 searchable)
  tool_name: string // Tool slug (filterable)
  display_name: string // Human-readable name (filterable)
  description: string // Tool description
  toolkit_name: string // App/toolkit name (filterable)
  created_at: string // ISO timestamp
}

Usage

import {
  TOOL_DISTANCE_METRIC,
  TOOL_SCHEMA,
  Turbopuffer,
} from '@composio/embeddings'

// Use schema when writing to TurboPuffer
const tpuf = new Turbopuffer({ apiKey: process.env.TURBOPUFFER_API_TOKEN })
const namespace = tpuf.namespace('tool-lookup-v3')

await namespace.write({
  upsert_rows: [...tools],
  schema: TOOL_SCHEMA,
  distance_metric: TOOL_DISTANCE_METRIC,
})

Design Context & Resources

Slack Discussions

Notion Documentation

  • See CLAUDE.md in this directory for AI assistant context
  • See /apps/apollo for tool search API implementation

FAQs

Package last updated on 07 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts