Python bindings for ProllyTree - a probabilistic tree for efficient storage and retrieval
Project description
ProllyTree Python Bindings
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3105b4da02ff5e07990afe4da919774613a932fcf2833c6914e0d24c0962381f
|
|
| MD5 |
451e0cbb128a446661f079da86870270
|
|
| BLAKE2b-256 |
65544138d4b85d63ebb72394ff34de7760a389bf0f0cdd3e132b0d1cfaca458b
|
File details
Details for the file prollytree-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: prollytree-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12f7282cd36106540a104792765a4d4a95dda26235847fb4a9cd21662eca106e
|
|
| MD5 |
4b0bd4e864f0907231a5c5ec9f4bb750
|
|
| BLAKE2b-256 |
00d865c55ec875a512cbcd063bf7ba8d185f8b8993ac0857de7e3636378143c7
|