Skip to content

wrtnlabs/connector-hive

Repository files navigation

connector-hive

A connector retrieval server that provides function interfaces for LLMs to interact with external services.

What is "connector"?

Connector is function interface that can be used to interact with external services. It is designed to be used by LLMs as tool.

Prerequisites

1. PostgreSQL with pgvector extension

This server requires PostgreSQL with the pgvector extension to store vector embeddings.

Using Docker (Recommended)

docker run -d \
  --name postgres-vector \
  -e POSTGRES_USER=your_user \
  -e POSTGRES_PASSWORD=your_password \
  -e POSTGRES_DB=your_database \
  -p 5432:5432 \
  pgvector/pgvector

Manual Installation

If you prefer to use an existing PostgreSQL instance, follow the instructions in the pgvector docs to install the extension.

2. Cohere API Key

The server uses Cohere API to generate embeddings. Get your API key by:

  1. Sign up at Cohere
  2. Navigate to API Key section
  3. Create a new API key

Installation & Usage

Using Docker (Recommended)

  1. Pull the latest image:
docker pull ghcr.io/wrtnlabs/connector-hive:latest
  1. Create a .env file based on the example:
PROJECT_API_PORT=37001
DATABASE_URL=postgresql://your_user:your_password@host.docker.internal:5432/your_database
COHERE_API_KEY=your_cohere_api_key
API_KEY=your_optional_api_key  # Optional: If set, all requests except GET /health must include this key
  1. Run the container:
docker run -d \
  --name connector-hive \
  --env-file .env \
  -p 37001:37001 \
  ghcr.io/wrtnlabs/connector-hive:latest

Using NPM Client SDK

We also provide a TypeScript/JavaScript client SDK:

npm install @wrtnlabs/connector-hive-api

For SDK usage, please refer to the API documentation.

Authentication

The server supports basic API key authentication:

  • If API_KEY is set in the environment variables, all requests except GET /health must include this key in the Authorization header:
    Authorization: Bearer your_api_key
    
  • If API_KEY is not set, the server operates without authentication.

Health Check

You can verify the server is running by making a GET request to the health endpoint:

curl http://localhost:37001/health

Development

  1. Clone the repository:
git clone https://github.com/wrtnlabs/connector-hive.git
cd connector-hive
  1. Install dependencies:
npm install
  1. Set up your environment:
cp .env.example .env
# Edit .env with your configuration
  1. Start the development server:
npm run dev

License

MIT License

Copyright (c) 2025 Wrtn Technologies