Metadata-Version: 2.1
Name: lorax-ai
Version: 0.1.0
Summary: Lorax is AI tool assistant to analyze and visualize trees
Keywords: egg,bacon,sausage,tomatoes,Lobster Thermidor
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.13,>=3.9
Description-Content-Type: text/markdown
Requires-Dist: aiohappyeyeballs==2.4.4
Requires-Dist: aiohttp==3.11.11
Requires-Dist: aiosignal==1.3.2
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.7.0
Requires-Dist: attrs==24.3.0
Requires-Dist: certifi==2024.12.14
Requires-Dist: charset-normalizer==3.4.1
Requires-Dist: click==8.1.8
Requires-Dist: dataclasses-json==0.6.7
Requires-Dist: distro==1.9.0
Requires-Dist: faiss-cpu==1.9.0.post1
Requires-Dist: fastapi==0.115.6
Requires-Dist: frozenlist==1.5.0
Requires-Dist: greenlet==3.1.1
Requires-Dist: h11==0.14.0
Requires-Dist: httpcore==1.0.7
Requires-Dist: httptools==0.6.4
Requires-Dist: httpx==0.28.1
Requires-Dist: httpx-sse==0.4.0
Requires-Dist: idna==3.10
Requires-Dist: jiter==0.8.2
Requires-Dist: jsonpatch==1.33
Requires-Dist: jsonpointer==3.0.0
Requires-Dist: jsonschema==4.23.0
Requires-Dist: jsonschema-specifications==2024.10.1
Requires-Dist: langchain==0.3.14
Requires-Dist: langchain-community==0.3.14
Requires-Dist: langchain-core==0.3.29
Requires-Dist: langchain-openai==0.2.14
Requires-Dist: langchain-text-splitters==0.3.4
Requires-Dist: langgraph==0.2.60
Requires-Dist: langgraph-checkpoint==2.0.9
Requires-Dist: langgraph-sdk==0.1.48
Requires-Dist: langsmith==0.2.10
Requires-Dist: MarkupSafe==3.0.2
Requires-Dist: marshmallow==3.23.3
Requires-Dist: msgpack==1.1.0
Requires-Dist: multidict==6.1.0
Requires-Dist: mypy-extensions==1.0.0
Requires-Dist: numpy==1.26.4
Requires-Dist: openai==1.59.3
Requires-Dist: orjson==3.10.13
Requires-Dist: packaging==24.2
Requires-Dist: propcache==0.2.1
Requires-Dist: pydantic==2.10.4
Requires-Dist: pydantic-settings==2.7.1
Requires-Dist: pydantic_core==2.27.2
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: python-multipart==0.0.20
Requires-Dist: PyYAML==6.0.2
Requires-Dist: referencing==0.35.1
Requires-Dist: regex==2024.11.6
Requires-Dist: requests==2.32.3
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: rpds-py==0.22.3
Requires-Dist: sniffio==1.3.1
Requires-Dist: SQLAlchemy==2.0.36
Requires-Dist: starlette==0.41.3
Requires-Dist: svgwrite==1.4.3
Requires-Dist: tenacity==9.0.0
Requires-Dist: tiktoken==0.8.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: tskit==0.6.0
Requires-Dist: typing-inspect==0.9.0
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: urllib3==2.3.0
Requires-Dist: uvicorn==0.34.0
Requires-Dist: uvloop==0.21.0
Requires-Dist: watchfiles==1.0.3
Requires-Dist: websockets==14.1
Requires-Dist: Werkzeug==3.1.3
Requires-Dist: yarl==1.18.3

# Treesequence_LLM_Viz
Query based Code Generation and Analysis of Tree-Sequence using LLM.

### Goal
The goal is to leverage Large-language Models(LLM) to generate code and analyze tree-sequences using tskit by simply asking questions in plain English. With Retrieval-Augmented Generation (RAG), users can input questions in plain English, and the system will generate executable tskit code to answer these queries. 

### Current Version:
In this initial proof-of-concept, the tskit source code is used as a knowledge base for the Large Language Model (LLM). When users input queries in natural language, the LLM generates the appropriate code based on the knowledge and returns a python function as a response. 

Current version is a naive ```prompt:answer``` approach which does not evaluate the accuracy of the generated code. 

### Next things to do.
- [x] Code generation can be improved using [Flow Engineering Approach](https://arxiv.org/pdf/2401.08500). Use LangGraph and openai Function Calling to setup the workflow. 
  ![alt text](assets/image.png)
- [x] Code execution with error checking.
- [x] Multiple Iterations.
- [x] Terminal chat interface / UI interface (flask-reactjs)
- [ ] human-in-the-loop. (human intervention to review the code or correct it.)
- [ ] Additional node(tool) to ask general tree-sequence question that are not related to code-generation.
- [ ] Accuracy/reliability of the generated answer.

### Exploration
-  How to enhance treesequence analysis. one way is [MemoRAG](https://github.com/qhjqhj00/MemoRAG). Memory-based knowledge discovery for long contexts. 

