Skip to main content

AgentVectorDB (AVDB): The Cognitive Core for Your AI Agents. A lightweight, embeddable vector database for Agentic AI systems, built on LanceDB.

Project description

🧠 AgentVectorDB (AVDB)

PyPI version Python License Documentation Code style: ruff PRs Welcome

The Cognitive Core for Your AI Agents - Powered by LanceDB

📚 Documentation Quick Links

🌟 Overview

AgentVectorDB (AVDB) is a specialized memory management system developed by Superagentic AI. Built on top of LanceDB's powerful vector database capabilities, it provides optimized cognitive architecture for AI agents.

🤝 Built with LanceDB

We extend LanceDB's robust foundation with agent-specific features:

  • Agent memory patterns
  • Importance scoring
  • Context management
  • Cognitive state handling

✨ Key Features

Core Capabilities

  • 📝 Persistent Storage: File-based, no server required
  • 🔍 Semantic Search: Efficient ANN search with filtering
  • ⚡ Async Support: High-performance async/await API
  • 🎯 Agent-Optimized: Purpose-built for AI systems

Advanced Features

  • 🔄 Memory Lifecycle: Complete CRUD operations
  • 📊 Batch Processing: Efficient bulk operations
  • 🧹 Smart Pruning: Intelligent memory management
  • 🔧 Flexible Schema: Dynamic Pydantic schemas
  • ⏱️ Time Tracking: Automatic timestamps

📦 Installation

# Basic installation
pip install agentvectordb

# With all extras (recommended)
pip install "agentvectordb[all]"

# Development installation
git clone https://github.com/superagenticai/agentvectordb.git
cd agentvectordb
pip install -e ".[dev]"

🚀 Quick Start

from agentvectordb import AgentVectorDBStore
from agentvectordb.embeddings import DefaultTextEmbeddingFunction

# Initialize store
store = AgentVectorDBStore(db_path="./agent_db")
ef = DefaultTextEmbeddingFunction(dimension=384)

# Create collection
memories = store.get_or_create_collection(
    name="agent_memories",
    embedding_function=ef
)

# Add memories (minimum 8 recommended)
initial_memories = [
    {
        "content": "User prefers dark mode",
        "type": "preference",
        "importance_score": 0.8
    },
    # Add more memories...
]

# Add batch
memories.add_batch(initial_memories)

# Query memories
results = memories.query(
    query_text="user preferences",
    k=2
)

🛠️ API Overview

Store Classes

AgentVectorDBStore

store = AgentVectorDBStore(db_path="./db")

Methods:

  • get_or_create_collection()
  • list_collections()
  • delete_collection()

AsyncAgentVectorDBStore

store = AsyncAgentVectorDBStore(db_path="./db")

Collection Classes

AgentMemoryCollection

Methods:

  • add(): Add single memory
  • add_batch(): Add multiple memories
  • query(): Search memories
  • prune_memories(): Remove old memories
  • delete(): Remove memories
  • count(): Get collection size

📚 Advanced Usage

Custom Embedding Functions

from agentvectordb.embeddings import BaseEmbeddingFunction

class CustomEmbedder(BaseEmbeddingFunction):
    def __init__(self, dimension=384):
        super().__init__(dimension=dimension)
    
    def embed(self, texts):
        # Your embedding logic here
        return vectors

Memory Management

# Prune old memories
pruned = collection.prune_memories(
    max_age_seconds=7*24*3600,  # 7 days
    min_importance_score=0.3
)

# Complex queries
results = collection.query(
    query_text="important task",
    filter_sql="type = 'task' AND importance_score > 0.8",
    k=5
)

Async Operations

async def handle_memories():
    store = AsyncAgentVectorDBStore(db_path="./async_db")
    collection = await store.get_or_create_collection(
        name="async_memories",
        embedding_function=ef
    )
    
    await collection.add_batch(memories)
    results = await collection.query(
        query_text="search term",
        k=5
    )

🎯 Use Cases

  • Personal AI assistants
  • Customer service bots
  • Research agents
  • Task automation agents
  • Knowledge management systems
  • Learning systems

🔄 Memory Types

  • Episodic memories
  • Semantic knowledge
  • Procedural information
  • Short-term observations
  • Long-term knowledge

🛣️ Roadmap

Upcoming features:

  • Enhanced filter builders
  • Reflection/summarization helpers
  • Schema evolution support
  • Memory consolidation
  • Extended embedding support
  • Performance optimizations

🤝 Contributing

We welcome contributions! See our Contributing Guide.

📄 License

Licensed under Apache 2.0 - same as LanceDB. See LICENSE.

🙋‍♂️ Support

🙏 Acknowledgments

Built with ❤️ by Superagentic AI using LanceDB


AgentVectorDB: Empower Your AI Agents with Memory!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentvectordb-0.0.2.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentvectordb-0.0.2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file agentvectordb-0.0.2.tar.gz.

File metadata

  • Download URL: agentvectordb-0.0.2.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for agentvectordb-0.0.2.tar.gz
Algorithm Hash digest
SHA256 763f34f35216dd8c71548fb8bbd292a0890cd2531e280b50055ea85f8eb1f71c
MD5 44cdae6f09032b6506ddbba8904fd01c
BLAKE2b-256 905a50b9e317b53986d73313f811ee82291c2d43bcbfb9862f1792fcdc20eef1

See more details on using hashes here.

File details

Details for the file agentvectordb-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: agentvectordb-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for agentvectordb-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08a3625c367a0a79c83926cd0d2c896879e953bdacce76e8fb165bd9b8edf2df
MD5 2408e86476c60c64ef25555072a766e9
BLAKE2b-256 bef1cc58c9f51fd2ac0c6bf3e33dd4e8577b20f11c3b2b020970b61d2bcd2717

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page