Skip to main content

Python bindings for ProllyTree - a probabilistic tree for efficient storage and retrieval

Project description

ProllyTree Python Bindings

Documentation PyPI

Python bindings for ProllyTree - a probabilistic tree data structure that combines B-trees and Merkle trees for efficient, verifiable data storage.

🚀 Quick Start

Installation

pip install prollytree

Basic Usage

from prollytree import ProllyTree

# Create a tree and insert data
tree = ProllyTree()
tree.insert(b"hello", b"world")
value = tree.find(b"hello")  # Returns b"world"

📚 Documentation

👉 Complete Documentation

The full documentation includes:

✨ Features

  • 🌳 Probabilistic Trees - High-performance data storage with automatic balancing
  • 🤖 AI Agent Memory - Multi-layered memory systems for intelligent agents
  • 📚 Versioned Storage - Git-like version control for key-value data
  • 🔐 Cryptographic Verification - Merkle proofs for data integrity
  • ⚡ SQL Queries - Query your data using SQL syntax

🔥 Key Use Cases

Probabilistic Trees

from prollytree import ProllyTree

tree = ProllyTree()
tree.insert(b"user:123", b"Alice")
tree.insert(b"user:456", b"Bob")

# Cryptographic verification
proof = tree.generate_proof(b"user:123")
is_valid = tree.verify_proof(proof, b"user:123", b"Alice")

AI Agent Memory

from prollytree import AgentMemorySystem

memory = AgentMemorySystem("./agent_memory", "agent_001")

# Store conversation
memory.store_conversation_turn("chat_123", "user", "Hello!")
memory.store_conversation_turn("chat_123", "assistant", "Hi there!")

# Store facts
memory.store_fact("person", "john", '{"name": "John", "age": 30}',
                  confidence=0.95, source="profile")

Versioned Storage

from prollytree import VersionedKvStore

store = VersionedKvStore("./data")
store.insert(b"config", b"production_settings")
commit_id = store.commit("Add production config")

# Branch and experiment
store.create_branch("experiment")
store.insert(b"feature", b"experimental_data")
store.commit("Add experimental feature")

SQL Queries

from prollytree import ProllySQLStore

sql_store = ProllySQLStore("./database")
sql_store.execute("CREATE TABLE users (id INT, name TEXT)")
sql_store.execute("INSERT INTO users VALUES (1, 'Alice')")
results = sql_store.execute("SELECT * FROM users WHERE name = 'Alice'")

🛠️ Development

Building from Source

git clone https://github.com/zhangfengcdt/prollytree
cd prollytree
./python/build_python.sh --all-features --install

Running Tests

cd python/tests
python test_prollytree.py

📄 License

Licensed under the Apache License, Version 2.0

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

prollytree-0.3.0.tar.gz (338.6 kB view details)

Uploaded Source

Built Distribution

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

prollytree-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file prollytree-0.3.0.tar.gz.

File metadata

  • Download URL: prollytree-0.3.0.tar.gz
  • Upload date:
  • Size: 338.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.1

File hashes

Hashes for prollytree-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3105b4da02ff5e07990afe4da919774613a932fcf2833c6914e0d24c0962381f
MD5 451e0cbb128a446661f079da86870270
BLAKE2b-256 65544138d4b85d63ebb72394ff34de7760a389bf0f0cdd3e132b0d1cfaca458b

See more details on using hashes here.

File details

Details for the file prollytree-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for prollytree-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12f7282cd36106540a104792765a4d4a95dda26235847fb4a9cd21662eca106e
MD5 4b0bd4e864f0907231a5c5ec9f4bb750
BLAKE2b-256 00d865c55ec875a512cbcd063bf7ba8d185f8b8993ac0857de7e3636378143c7

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