❓ Frequently Asked Questions
About AgentVectorDB (AVDB)
What is AgentVectorDB?
AgentVectorDB (AVDB) is a specialized vector database designed for AI agents, developed by Superagentic AI (opens in a new tab). It provides:
- Efficient memory storage and retrieval
- Semantic search capabilities
- Async/sync API support
- Built-in importance scoring
- Metadata management
Why use AgentVectorDB?
- Purpose-built for agents: Optimized for agent memory management
- Production-ready: Built on LanceDB's reliable foundation
- Flexible: Works with any embedding model
- Fast: High-performance vector operations
- Easy to use: Simple, intuitive API
Relationship with LanceDB
AgentVectorDB (AVDB) is built on top of LanceDB and shares the same Apache 2.0 license. It's not a competitor but rather a specialized layer adding agent-specific features while leveraging LanceDB's robust vector database capabilities.
Technical Implementation
Python Version Support
# Supported Python versions:
# - Python 3.12
# Check your version
import sys
print(sys.version)
Custom Embedding Models
from agentvectordb.embeddings import BaseEmbeddingFunction
import numpy as np
class CustomEmbedder(BaseEmbeddingFunction):
def __init__(self, dimension: int = 384):
super().__init__(dimension=dimension)
def embed(self, texts: List[str]) -> np.ndarray:
# Your embedding logic here
return np.random.rand(len(texts), self.dimension)
# Usage
embedder = CustomEmbedder(dimension=384)
collection = store.get_or_create_collection(
name="memories",
embedding_function=embedder
)
Vector Dimensions
Recommended dimensions based on use case:
- Basic embeddings: 64-384 dimensions
- Language models: 384-768 dimensions
- Advanced models: 768-1536 dimensions
- Specialized cases: Up to 4096 dimensions
Concurrent Access
from agentvectordb import AsyncAgentVectorDBStore
import asyncio
async def safe_concurrent_ops():
store = AsyncAgentVectorDBStore(db_path="./agent_db")
collection = await store.get_or_create_collection("shared_memories")
# Concurrent operations
tasks = [
collection.add(content=f"Memory {i}", type="test")
for i in range(10)
]
await asyncio.gather(*tasks)
Performance Optimization
Batch Operations
# Recommended batch sizes
BATCH_SIZES = {
"realtime": 50, # For real-time applications
"standard": 500, # For normal operations
"bulk": 2000 # For data migration
}
def batch_processor(collection, items, batch_size=BATCH_SIZES["standard"]):
"""Process items in optimal batch sizes."""
for i in range(0, len(items), batch_size):
batch = items[i:i + batch_size]
try:
collection.add_batch(batch)
except Exception as e:
print(f"Batch {i}-{i+batch_size} failed: {e}")
Query Optimization
# Efficient querying
results = collection.query(
query_text="important memory",
k=5,
filter_sql="type = 'critical' AND importance_score > 0.8",
include_vectors=False # Set to True only if needed
)
Error Handling
Common Exceptions
from agentvectordb.exceptions import (
AgentVectorDBException, # Base exception
InitializationError, # Database setup issues
SchemaError, # Schema validation failures
QueryError, # Search/query issues
OperationError # General operations
)
def safe_operation(func):
"""Decorator for safe memory operations."""
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except SchemaError as e:
print(f"Schema validation failed: {e}")
except QueryError as e:
print(f"Query failed: {e}")
except Exception as e:
print(f"Unexpected error: {e}")
return None
return wrapper
Contributing Guide
Setup Development Environment
# Clone repository
git clone https://github.com/superagenticai/agentvectordb.git
cd agentvectordb
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Run Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=agentvectordb
Submit Changes
- Fork the repository
- Create feature branch
- Follow code style (black, ruff)
- Add tests for new features
- Update documentation
- Submit pull request
Support & Resources
Get Help
- GitHub Issues: Technical issues & features
- Discord Community: Real-time support
- Documentation: agentvectordb.readthedocs.io (opens in a new tab)
- Email: support@super-agentic.ai
Citation
@software{agentvectordb2024,
title = {AgentVectorDB: The Cognitive Core for AI Agents},
author = {Jagtap, Shashi and {Superagentic AI}},
year = {2024},
url = {https://github.com/superagenticai/agentvectordb}
}
License
AgentVectorDB is licensed under the Apache 2.0 License, the same as LanceDB. This ensures:
- Commercial use allowed
- Modification allowed
- Distribution allowed
- Private use allowed
- Patent use included
- Trademark use excluded
For enterprise support, custom features, or consulting:
- Email: enterprise@super-agentic.ai
- Website: super-agentic.ai (opens in a new tab)