Quickstart

Usage

Basic Operations

  1. Initialize and Start a Node

import asyncio
from vectrs.network import KademliaNode
from vectrs.database import VectorDBManager

async def start_node():
    # Initialize node
    node = KademliaNode(host='127.0.0.1', port=8468)
    db_manager = VectorDBManager()
    node.set_local_db_manager(db_manager)
    
    # Start node
    await node.start()
    
    # Optional: Connect to existing network
    await node.bootstrap('bootstrap_host', 8468)
    return node

# Run the node
node = asyncio.run(start_node())
  1. Create Database

  1. Vector Operations

Graph Operations

AI and RAG Features

You can provide your Claude API key in three ways:

  1. Pass it directly to the Swarms constructor

  2. Set it as an environment variable: export ANTHROPIC_API_KEY=your-api-key

  3. Use the CLI argument: python -m vectrs start-node --anthropic_api_key your-api-key

Advanced Features

Graphine Search

Command Line Interface

Last updated