DynamiTree is an efficient memory-augmented QA system that leverages a B+ Tree structure for storing and summarizing facts. It supports dynamic insertions, hierarchical summarization, and relevance-based retrieval, making it suitable for tasks like long document or meeting QA, policy tracking, and more.
├── demo.py # Main orchestration script
├── requirements.txt
DynamiTree/
├── utils.py # Core B+ Tree logic, insert/retrieve/generate
├── answer_prompt.py # Prompt for answering questions
├── summary_prompt.py # Prompt for summarization
git clone https://github.com/charvibannur/DynamiTree.git
cd DynamiTree/GithubUsing Conda:
conda create -n dynami-tree python=3.9
conda activate dynami-tree
pip install -r requirements.txtAdd your OpenAI or Together AI API keys directly to utils.py by setting:
os.environ["OPENAI_API_KEY"] = "your_openai_api_key"
os.environ["TOGETHER_API_KEY"] = "your_together_api_key"
os.environ["TOGETHER_BASE_URL"] = "https://api.together.xyz/v1"You can insert custom facts and run ad hoc queries like this:
from demo import initialize_tree_and_insert, query_tree_and_answer
initialize_tree_and_insert("Fact 1...")
initialize_tree_and_insert("Fact 2...")
query_tree_and_answer("Query")MIT License © 2025. See the LICENSE file in the repository for full details.
