Skip to main content

Full-stack AI enablement platform

Project description

๐Ÿฌ dolphin

โš ๏ธ EXPERIMENTAL - This is a developmental library under active development. APIs and interfaces are unstable and subject to change without notice.

A semantic code search and knowledge management system with AI-native interfaces (MCP, REST API, CLI).

Quick Start

Installation

# Install from PyPI
uvx install pb-dolphin

# โš ๏ธ IMPORTANT: Ensure OPENAI_API_KEY is set as env var

Basic Usage

# Initialize global knowledge store and index a repository
dolphin init
dolphin add-repo my-project /path/to/project
dolphin index my-project

# Search your indexed code
dolphin search "authentication logic"

# Start API server
dolphin serve

Core Commands

  • dolphin init - Initialize configuration (auto-creates ~/.dolphin/config.toml)
  • dolphin init --repo - Create repo-specific config in current directory
  • dolphin add-repo <name> <path> - Register a repository for indexing
  • dolphin index <name> - Index a repository with language-aware chunking
  • dolphin search <query> - Search indexed code semantically
  • dolphin serve - Start REST API server (port 7777)
  • dolphin config --show - Display current configuration

Architecture

High-Level Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Interfaces (Claude, Continue, etc)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚ MCP Protocol
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Dolphin Knowledge Base          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ MCP Bridge  โ”‚โ—„โ”€โ”€โ–บโ”‚ REST API       โ”‚  โ”‚
โ”‚  โ”‚ (TypeScript)โ”‚    โ”‚ (Python/FastAPI)โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
               โ–ผ                            โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚LanceDB  โ”‚                โ”‚ SQLite   โ”‚
          โ”‚(Vectors)โ”‚                โ”‚(Metadata)โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Features

  • Language-Aware Chunking - Intelligent code parsing for Python, TypeScript, JavaScript, Markdown
  • Semantic Search - OpenAI embeddings with LanceDB vector storage
  • MCP Support - Native Model Context Protocol integration for Claude Desktop
  • REST API - FastAPI server with search, retrieval, and metadata endpoints
  • Unified CLI - Single dolphin command for all operations
  • Auto-Configuration - Smart config hierarchy (repo โ†’ user โ†’ defaults)

Environment Variables

Dolphin requires the following environment variables depending on your usage:

Required for OpenAI Embeddings

# Required when using OpenAI embeddings (recommended for production)
export OPENAI_API_KEY="sk-your-openai-api-key-here"

Getting Your OpenAI API Key

  1. Visit OpenAI Platform
  2. Sign up or log in to your account
  3. Navigate to API Keys
  4. Click "Create new secret key"
  5. Copy the key and set it as OPENAI_API_KEY

Configuration

Dolphin uses a multi-level configuration system:

  1. Repo-specific (./.dolphin/config.toml) - Per-repository chunking settings
  2. User-global (~/.dolphin/config.toml) - Auto-created on first use

Example Config

# ~/.dolphin/config.toml
default_embed_model = "large"  # or "small"

[embedding]
provider = "openai"
batch_size = 100

[retrieval]
top_k = 8
score_cutoff = 0.15

Claude Desktop Integration (MCP)

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "dolphin": {
      "command": "bun",
      "args": ["run", "/path/to/dolphin/mcp-bridge/src/index.ts"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Start the server: dolphin serve

Available MCP tools: search_knowledge, fetch_chunk, fetch_lines, get_vector_store_info

REST API

# Start server
dolphin serve

# Search
curl -X POST http://127.0.0.1:7777/v1/search \
  -H "Content-Type: application/json" \
  -d '{"query": "authentication", "top_k": 5}'

# List repositories
curl http://127.0.0.1:7777/v1/repos

# Health check
curl http://127.0.0.1:7777/v1/health

Development Status

Current: Pre-alpha (0.1.x)

  • โœ… Core indexing and search pipeline
  • โœ… Language-aware chunking (Python, TS, JS, Markdown)
  • โœ… REST API with MCP bridge
  • โš ๏ธ Developmental stage

Upcoming:

  • Performance optimization
  • Production hardening
  • Evaluation framework
  • Expanded language support

Requirements

  • Python โ‰ฅ3.12
  • OpenAI API key (for embeddings)
  • Bun (for MCP bridge)
  • Git (for repository scanning)

Testing

# Run all tests
uv run pytest

# Run specific test suite
uv run pytest tests/unit/
uv run pytest tests/integration/

License

MIT License

Acknowledgments

Built with LanceDB, OpenAI, FastAPI, and Bun


โš ๏ธ Remember: This is experimental software under active development. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pb_dolphin-0.1.9.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pb_dolphin-0.1.9-py3-none-any.whl (116.2 kB view details)

Uploaded Python 3

File details

Details for the file pb_dolphin-0.1.9.tar.gz.

File metadata

  • Download URL: pb_dolphin-0.1.9.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pb_dolphin-0.1.9.tar.gz
Algorithm Hash digest
SHA256 894d238922eeeae412511d0b1ca013548f75cd1fea0dda2fe676c11e7f321f02
MD5 7ca9e2e8c8103d472cf6eb51ff3ac2aa
BLAKE2b-256 f0562200a71ee49a3dafa3a8c92f9e2acbc88bc407ec238bcc0df6973d469843

See more details on using hashes here.

File details

Details for the file pb_dolphin-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pb_dolphin-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 116.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pb_dolphin-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 e931e045c968d4dc4ed61062f05a2969017043c160b5edf20f261da2a0e53e89
MD5 d166194c13543ea5e09c37e98a8e3913
BLAKE2b-256 77198baed2a291a640d0850cb51f4b8557c60d55fa1873446c52c982c8e977b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page