Build a vector-aware AI coding assistant with seekdb and Claude Code
Claude Code is Anthropic's AI coding assistant with strong code understanding and generation capabilities. However, if you ask Claude Code seekdb-specific questions, the answers may be incomplete or inaccurate, simply because seekdb is a newer AI-native search database and may not be well covered in the model's training data.
In this tutorial, you will build a simple seekdb hybrid search application in Python, and you will learn how to install the seekdb Claude Code plugin so Claude Code can retrieve seekdb official documentation and provide more accurate, best-practice guidance while you build.
About the seekdb Claude Code plugin
The seekdb Claude Code plugin is an Agent Skill plugin. It enables Claude Code to retrieve and reference seekdb official documentation so it can:
- Understand seekdb concepts, including vector search, hybrid search, and AI functions.
- Provide accurate code suggestions based on official best practices.
- Answer seekdb questions directly from your terminal workflow.
- Speed up development by reducing time spent searching documentation.
For more information, see seekdb Agent Skill.
Prerequisites
-
Node.js 18 or later is installed.
-
You can access GitHub (required to install the plugin and fetch the latest documentation).
-
Claude Code is installed. If not, install it with:
npm install -g @anthropic-ai/claude-codeAfter installation, configure your API key:
export ANTHROPIC_API_KEY="your-api-key-here"
# Set the API base URL (only if you use a proxy or a custom endpoint)
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
Step 1: Configure network access
The seekdb Agent Skill plugin fetches the latest documentation from GitHub, so Claude Code must be allowed to make network requests.
In your project root directory, create or edit .claude/settings.local.json:
{
"skipWebFetchPreflight": true
}
Setting skipWebFetchPreflight to true skips the preflight check for network requests and lets Claude Code access remote documentation directly. If GitHub is unreachable, the plugin automatically falls back to local documentation.
Step 2: Install the seekdb plugin
In your project root directory, run claude to start Claude Code.
-
Add the seekdb Marketplace:
/plugin marketplace add oceanbase/seekdb-ecology-plugins -
Install the plugin:
/plugin install seekdb-plugin@seekdb -
Restart Claude Code.
After installation, exit and restart Claude Code to ensure the plugin loads correctly. Once loaded, you can ask Claude Code any seekdb-related question and get answers grounded in official documentation.
Step 3: Build a seekdb hybrid search app with Claude Code
After installing the plugin, start a new chat in Claude Code and ask:
I want to build a simple seekdb app in Python that supports hybrid search over documents. Please write the code.
Claude Code should respond with an implementation similar to the following:
import pyseekdb
# ==================== Create a collection ====================
# Create an embedded client
client = pyseekdb.Client(path="./seekdb.db")
# Create a collection
collection = client.create_collection(name="hybrid_search_demo")
# ==================== Add data ====================
documents = [
"Machine learning is revolutionizing artificial intelligence and data science",
"Python programming language is essential for machine learning developers",
"Deep learning neural networks enable advanced AI applications",
"Data science combines statistics, programming, and domain expertise",
"Natural language processing uses machine learning to understand text",
"Computer vision algorithms process images using deep learning techniques",
"Reinforcement learning trains agents through reward-based feedback",
"Python libraries like TensorFlow and PyTorch simplify machine learning",
"Artificial intelligence systems can learn from large datasets",
"Neural networks mimic the structure of biological brain connections",
]
metadatas = [
{"category": "AI", "topic": "machine learning", "year": 2023, "popularity": 95},
{"category": "Programming", "topic": "python", "year": 2023, "popularity": 88},
{"category": "AI", "topic": "deep learning", "year": 2024, "popularity": 92},
{"category": "Data Science", "topic": "data analysis", "year": 2023, "popularity": 85},
{"category": "AI", "topic": "nlp", "year": 2024, "popularity": 90},
{"category": "AI", "topic": "computer vision", "year": 2023, "popularity": 87},
{"category": "AI", "topic": "reinforcement learning", "year": 2024, "popularity": 89},
{"category": "Programming", "topic": "python", "year": 2023, "popularity": 91},
{"category": "AI", "topic": "general ai", "year": 2023, "popularity": 93},
{"category": "AI", "topic": "neural networks", "year": 2024, "popularity": 94},
]
ids = [f"doc_{i + 1}" for i in range(len(documents))]
collection.add(ids=ids, documents=documents, metadatas=metadatas)
# ==================== Perform hybrid search ====================
hybrid_result = collection.hybrid_search(
query={"where_document": {"$contains": "machine learning"}, "n_results": 10},
knn={"query_texts": ["AI research"], "n_results": 10},
rank={"rrf": {}},
n_results=5,
)
# ==================== Print results ====================
print("\\nHybrid search results:")
print(f" ids: {hybrid_result['ids'][0]}")
print(f" documents: {hybrid_result['documents'][0]}")
Step 4: Run the example
-
Install
pyseekdb:pip install pyseekdb -
Save the code to
hybrid_search_demo.py, then run:python hybrid_search_demo.py -
Review the results. Example output:
ids: ['doc_1', 'doc_5', 'doc_2', 'doc_8', 'doc_3']
documents: ['Machine learning is revolutionizing artificial intelligence and data science', 'Natural language processing uses machine learning to understand text', 'Python programming language is essential for machine learning developers', 'Python libraries like TensorFlow and PyTorch simplify machine learning', 'Deep learning neural networks enable advanced AI applications']Hybrid search combines keyword matching (documents containing "machine learning") and semantic search (documents semantically similar to "AI research"). seekdb uses RRF (Reciprocal Rank Fusion) to merge the two result sets into a single ranked list.