Data structures for AI knowledge bases.
pip install dataknobs-structures
from dataknobs_structures import Tree, Document
# Create a tree structure
tree = Tree()
tree.add_node("root", "Root Node")
tree.add_node("child1", "Child 1", parent="root")
# Create a document
doc = Document(
content="Sample document content",
metadata={"author": "John Doe", "date": "2024-01-01"}
)
See LICENSE file in the root repository.