Elaway Knowledge Base API

MCP-compatible REST API for semantic search across documents, support tickets, Slack discussions, and WoD deals

32 Tools · JSON-RPC 2.0

What It Is

Search engine for Elaway's internal knowledge - documents, support history, Slack conversations, and deal data. Automatically syncs daily from 8+ sources and provides semantic search via 32 specialized tools.

Who Uses It

Sales: Find similar deals, pricing history, customer issues
Support: Search past ticket resolutions, common problems, FAQs
Product: Discover feature requests, bugs, usage patterns
Leadership: Access company docs, meeting notes, decisions

Typical Use Cases

How It Works

  1. Daily syncs pull latest data from Notion (05:00), HubSpot (06:00), Slack (06:00)
  2. Embeddings generated for all text using OpenAI (1536-dim vectors)
  3. Stored in pgvector with HNSW indexes for fast similarity search
  4. Query via JSON-RPC using semantic search or table filters
  5. Results ranked by cosine similarity and returned with full context
9,588
Documents
15,095
Tickets
893
Slack
57
WoD Deals
127
Notion

Quick Start

POST /functions/v1/mcp-readonly

Base URL: https://<PROJECT_REF>.supabase.co

Example Request

curl -X POST "https://<PROJECT_REF>.supabase.co/functions/v1/mcp-readonly" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "kb_search",
      "arguments": {
        "query": "charging error codes",
        "match_count": 5
      }
    }
  }'

Available Tools

Search & Discovery

kb_search

Primary semantic search across all sources (documents, tickets, Slack, WoD)

search

OpenAI Deep Research compatible search (flat results)

fetch

Get full content by ID after search

Data Browsing

query_table

SQL-like queries with filters (up to 500 rows)

count_rows

Aggregations, statistics, group by

list_tables

Discover all 14 tables and schemas

db_table_stats

Quick row counts for all tables

Relationship Traversal

fetch_thread_messages

Complete Slack thread (up to 200 messages)

fetch_conversation_messages

Complete HubSpot ticket thread

fetch_document_full

Full document content (up to 200K chars)

fetch_wod_deal_full

Complete WoD deal with circuits, costs, offers

fetch_notion_children

Navigate Notion page hierarchy

Analytics & Insights

analyze_slack_thread_network

Identify experts by participation

analyze_training_resolution_patterns

Common issues and resolutions

find_similar_documents

Find docs by metadata similarity

compare_wod_deals

Side-by-side deal comparison (2-5 deals)

aggregate_costs_by_category

WoD cost analytics

get_data_freshness_report

Check sync status for all sources

Embedding Tools

get_embeddings

Raw 1536-dimensional vectors

generate_embedding

Convert text to vector

compute_similarity

Compare text against records

Database Schema

Table Records Description
documents 9,588 PDFs, Word docs, FAQs, specifications, guides
training_conversations 15,095 HubSpot support tickets with embeddings
training_messages ~50K Individual messages within conversations
slack_threads 450+ Slack thread root messages
slack_messages 893 Slack messages with embeddings
wod_deals 57 Wheel of Deal pricing (42 columns)
notion_pages 127 Platform documentation

Data Freshness

Source Sync Schedule
Slack messages Daily at 06:00 UTC
HubSpot tickets Daily at 06:00 UTC
Notion pages Daily at 05:00 UTC
Documents Manual ingestion

Response Format

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"results\": [...], \"total\": 5}"
      }
    ]
  }
}