Skip to main content

Make seekdb work with Cursor AI

AI-assisted coding tools like Cursor can dramatically speed up development. But when you ask Cursor questions about seekdb, 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.

This tutorial shows how to use the seekdb Cursor Extension to give Cursor up-to-date seekdb knowledge by adding official documentation and rule files under .cursor/rules. You will then use the AI assistant to build a simple hybrid search demo in Python.

About the seekdb Cursor Extension

The seekdb Cursor Extension is a Cursor extension that helps Cursor's AI assistant retrieve and reference seekdb official documentation by injecting rules into the .cursor/rules directory. This enables the assistant to:

  • Understand seekdb concepts such as vector search, hybrid search, and AI functions.
  • Generate code that follows official best practices.
  • Answer seekdb questions directly in the editor.
  • Reduce time spent searching docs so you can focus on your application logic.

Core features

  • One-click install: Install from the Cursor Extension Marketplace.
  • Comprehensive documentation context: Adds seekdb official documentation covering vector search, hybrid search, AI functions, and more.
  • Dual-mode sourcing: Prefers the latest docs from GitHub, with local docs as a fallback.

How it works

The extension works in three steps:

  • Rule injection: Adds seekdb documentation and .mdc rule files to .cursor/rules.
  • Context loading: Cursor automatically reads .cursor/rules and uses it as context for the AI assistant.
  • Grounded answers: When you ask seekdb-related questions, the assistant answers based on the injected docs and rules.

Step 1: Install the extension

  1. Open the Extensions view in Cursor (Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS).
  2. Search for seekdb.
  3. Click Install.

Step 2: Add seekdb documentation to your project

  1. Open a project folder in Cursor (the documentation will be added to that folder).

  2. Open the Command Palette:

    • Windows/Linux: Ctrl+Shift+P
    • macOS: Cmd+Shift+P
  3. Search for seekdb or Add seekdb Docs, then select Add seekdb Docs.

  4. Cursor will add:

    • .cursor/rules/seekdb-docs (official documentation)
    • .cursor/rules/seekdb.mdc (rule file)
  5. Reload the window to activate the rules.

Once this is done, you can ask Cursor AI any seekdb-related question and get answers grounded in the official documentation.

Step 3: Use Cursor AI to build a seekdb hybrid search demo

Start a new chat in Cursor and ask:

I want to create a simple seekdb application in Python that implements hybrid search functionality. Please help me write the code.

Cursor AI should return an implementation similar to the following:

"""
seekdb hybrid search quick start

This is a minimal example to help you get started.
"""

import pyseekdb

# 1) Create a client (embedded mode)
client = pyseekdb.Client()

# 2) Create or load a collection
collection = client.get_or_create_collection(name="my_docs")

# 3) Add documents
documents = [
"Machine learning is a core technology of artificial intelligence.",
"Python is a popular language for machine learning.",
"Deep learning often requires large amounts of training data.",
"Natural language processing helps computers understand human language.",
"Vector databases store and retrieve vector data for similarity search.",
]

metadatas = [
{"category": "AI", "year": 2024},
{"category": "Programming", "year": 2024},
{"category": "AI", "year": 2023},
{"category": "AI", "year": 2024},
{"category": "Database", "year": 2024},
]

ids = [f"doc_{i}" for i in range(len(documents))]
collection.add(ids=ids, documents=documents, metadatas=metadatas)
print(f"Added {len(documents)} documents.")

# 4) Run hybrid search:
# - Full-text keyword filter: documents containing "machine learning"
# - Vector semantic query: content similar to "AI technology"
results = collection.hybrid_search(
query={
"where_document": {"$contains": "machine learning"},
"n_results": 10,
},
knn={
"query_texts": ["AI technology"],
"n_results": 10,
},
rank={"rrf": {}},
n_results=3,
include=["documents", "metadatas"],
)

# 5) Print results
print("\nHybrid search results:")
for i, (doc, meta) in enumerate(
zip(results["documents"][0], results["metadatas"][0]), start=1
):
print(f" [{i}] {doc}")
print(f" Metadata: {meta}\n")

# 6) Cleanup (optional)
# client.delete_collection("my_docs")

Step 4: Run the example

  1. Install pyseekdb:

    pip install pyseekdb
  2. Save the code to quick_start_hybrid_search.py, then run:

    python quick_start_hybrid_search.py
  3. Example output:

    Added 5 documents.

    Hybrid search results:
    [1] Machine learning is a core technology of artificial intelligence.
    Metadata: {'year': 2024, 'category': 'AI'}

    [2] Deep learning often requires large amounts of training data.
    Metadata: {'year': 2023, 'category': 'AI'}

    [3] Python is a popular language for machine learning.
    Metadata: {'year': 2024, 'category': 'Programming'}

Hybrid search combines keyword matching (for example, documents containing “machine learning”) and semantic search (documents similar to “AI technology”). seekdb uses RRF (Reciprocal Rank Fusion) to merge both result sets into a single ranked list.

Step 5: Remove the documentation

If you no longer need the seekdb documentation in this project:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Type Remove seekdb Docs.
  3. Select the command to run it.

Cursor will remove the documentation from .cursor/rules.