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 for AI interface. This package includes an indexing program managed by the user and an HTTP retrieval server. The companion MCP server is available at bunx dolphin-mcp.
Quick Start
Installation
Core Installation (~200MB)
# install with uv (recommended)
uv pip install pb-dolphin
# ensure OPENAI_API_KEY is set as env var
export OPENAI_API_KEY="sk-your-key-here"
Optional: Cross-Encoder Reranking (~2GB additional)
For advanced search quality improvement (+20-30% MRR):
uv pip install "pb-dolphin[reranking]"
Trade-off: Better relevance but 2-3x slower searches. See Advanced Features for configuration.
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 directorydolphin add-repo <name> <path>- Register a repository for indexingdolphin index <name>- Index a repository with language-aware chunkingdolphin search <query>- Search indexed code semanticallydolphin 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 - Code parsing for Python, TypeScript, JavaScript, Markdown
- Semantic Search
- OpenAI embeddings with LanceDB vector storage
- Hybrid approximate nn vector + BM25 keyword search with RRF scoring
- Re-ranking with cross-encoder
- MMR relevancy enhancement
- Interfaces
dolphinCLI app- FastAPI server with search, retrieval, and metadata endpoints
- MCP server implementation available at
bunx dolphin-mcp
- Configuration - Per-repo chunking and ignore configuration
Configuration
Dolphin uses a multi-level configuration system:
- Repo-specific (
./.dolphin/config.toml) - Optional per-repository chunking settings - User-global (
~/.dolphin/config.toml) - Auto-created on first use
Configuration TOMLs
You can use dolphin init to initialize your global config and edit from there.
# ~/.dolphin/config.toml
default_embed_model = "large" # or "small"
[embedding]
provider = "openai"
batch_size = 100
[retrieval]
top_k = 8
score_cutoff = 0.0
To generate a repo-specific config, use dolphin init --repo at the repository root.
Environment Variables
# Required when using OpenAI embeddings (recommended for production)
export OPENAI_API_KEY="sk-your-openai-api-key-here"
Post-Commit Hook (recommended)
Add this line to the repo's .git/postcommit file, inserting the actual repo name.
uv run dolphin index {repo-name}
Since the indexer walks the git diff, your repository index will always remain fresh.
MCP Configuration
The small companion MCP interface can be run via bun without install. Add to your favorite AI application's config:
{
"mcpServers": {
"dolphin": {
"command": "bunx",
"args": ["dolphin-mcp"]
}
}
}
Make sure you are running the HTTP retrieval server: uv run dolphin serve
Available MCP tools: search_knowledge, fetch_chunk, fetch_lines, get_vector_store_info
REST API
# Start server
dolphin serve
# Health check
curl http://127.0.0.1:7777/health
# List repositories
curl http://127.0.0.1:7777/repos
# Search "authentication"
curl -X POST http://127.0.0.1:7777/search \
-H "Content-Type: application/json" \
-d '{"query": "authentication", "top_k": 5}'
Advanced Features
Cross-Encoder Reranking
Cross-encoder reranking improves search result relevance by re-scoring each result pairwise against the query using an ML model, leading to 20-30% improvements in search result ranking quality (Nogueira & Cho, 2019).
Performance Impact:
- โ ๏ธ 2-3x slower searches - cross-encoder is compute-intensive
- โ ๏ธ ~2GB install size - requires torch and sentence-transformers
Installation
uv pip install "pb-dolphin[reranking]"
Configuration
Enable in your ~/.dolphin/config.toml:
[retrieval.reranking]
enabled = true # Enable cross-encoder reranking
model = "cross-encoder/ms-marco-MiniLM-L-6-v2" # HuggingFace model
device = "" # Auto-detect (CPU or CUDA if available)
batch_size = 32 # Higher = faster but more memory
candidate_multiplier = 4 # Rerank top_k ร multiplier candidates
score_threshold = 0.3 # Minimum relevance score (0-1)
Restart the API server to apply changes:
uv run dolphin serve
Development Status
Current: Beta (0.1.x)
- โ Core indexing and search pipeline
- โ Language-aware chunking (Python, TS, JS, Markdown)
- โ
REST API with MCP bridge available at
bunx dolphin-mcp - โ ๏ธ 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, Bun, and lots of other tech.
โ ๏ธ Remember: This is experimental software under active development. Use at your own risk.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pb_dolphin-0.1.13.tar.gz.
File metadata
- Download URL: pb_dolphin-0.1.13.tar.gz
- Upload date:
- Size: 106.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a239caca32d3b5da4cb2587851a695afa03026369c380896b66b72babe18c972
|
|
| MD5 |
7b7621537ff1747ba1fb9c6608621009
|
|
| BLAKE2b-256 |
55289ceb27953b96af3eeebc1e3ac7a239c328ed855f21e565cdf9ce8c2ecf94
|
File details
Details for the file pb_dolphin-0.1.13-py3-none-any.whl.
File metadata
- Download URL: pb_dolphin-0.1.13-py3-none-any.whl
- Upload date:
- Size: 137.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fffac572425c4cb1a9d8700f7212bd4e8331abeba01f3d76a191dc4a83481916
|
|
| MD5 |
3440870b4f99d4cb97d7e43eb7325b80
|
|
| BLAKE2b-256 |
899e9fa96e3be287ad0e6cf4fcf6ee4a1014bb17f82625f065efbf4994d5b7aa
|