Update README.md
Browse files
README.md
CHANGED
|
@@ -1,144 +1,8 @@
|
|
| 1 |
-
<!--
|
| 2 |
-
___ _ _ _
|
| 3 |
-
/ _ \ | | | | | |
|
| 4 |
-
/ /_\ \__ _ _ __ __ _ __| | ___| |__ ___ __| | ___ ___
|
| 5 |
-
| _ / _` | '__/ _` |/ _` |/ _ \ '_ \ / _ \ / _` |/ _ \/ __|
|
| 6 |
-
| | | | (_| | | | (_| | (_| | __/ | | | (_) | (_| | __/\__ \
|
| 7 |
-
\_| |_/\__,_|_| \__,_|\__,_|\___|_| |_|\___/ \__,_|\___||___/
|
| 8 |
-
|
| 9 |
-
Welcome to **Ankelodon**, a modular multi‑agent framework for complex question answering and data analysis.
|
| 10 |
-
This project leverages [LangGraph](https://python.langgraph.org/) and [LangChain](https://python.langchain.com/) to orchestrate a suite of tools that can plan, execute and validate tasks on your behalf.
|
| 11 |
-
|
| 12 |
-
-->
|
| 13 |
-
|
| 14 |
-
# 🧬 Ankelodon Multi‑Agent System
|
| 15 |
-
|
| 16 |
-
**Ankelodon** is a proof‑of‑concept multi‑tool agent inspired by the GAIA evaluation framework.
|
| 17 |
-
It combines planning, execution and critique to solve open‑ended queries that might involve search, file analysis, mathematics, coding or image understanding.
|
| 18 |
-
By breaking down tasks into manageable steps and selecting the right tool for each job, Ankelodon aims to deliver accurate answers with verifiable evidence.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
## 🌟 Features
|
| 22 |
-
|
| 23 |
-
### 🧠 Complexity assessment & routing
|
| 24 |
-
|
| 25 |
-
Before doing any heavy lifting, Ankelodon evaluates the incoming query to determine whether it requires planning or can be answered directly.
|
| 26 |
-
Simple questions (e.g. definitions, single mathematical operations) are answered via a lightweight executor.
|
| 27 |
-
Moderate and complex queries trigger the planner and agent pipeline, ensuring appropriate decomposition and tool usage.
|
| 28 |
-
|
| 29 |
-
### 🧭 Structured planning
|
| 30 |
-
|
| 31 |
-
For non‑trivial tasks, a **planner** LLM generates a structured plan consisting of a series of steps.
|
| 32 |
-
Each step has an ID, goal, selected tool, expected result and fallback strategy.
|
| 33 |
-
The plan is stored as a Pydantic model (`PlannerPlan`) with strong typing for reliability.
|
| 34 |
-
|
| 35 |
-
### 🤖 Agent execution
|
| 36 |
-
|
| 37 |
-
The **agent** node follows the plan step‑by‑step.
|
| 38 |
-
For each step it first produces reasoning, then invokes the suggested tool with the appropriate inputs.
|
| 39 |
-
Tool outputs are captured and fed back into subsequent reasoning.
|
| 40 |
-
The agent continues until all steps are complete or an error requires replanning.
|
| 41 |
-
|
| 42 |
-
### 🧰 Rich toolset
|
| 43 |
-
|
| 44 |
-
Ankelodon exposes a curated set of tools bound to the execution LLM:
|
| 45 |
-
|
| 46 |
-
| Tool | Purpose |
|
| 47 |
-
|---|---|
|
| 48 |
-
| `download_file_from_url` | Download files from the web by URL |
|
| 49 |
-
| `web_search` | Perform internet search via Tavily API |
|
| 50 |
-
| `arxiv_search` | Find relevant academic papers on arXiv |
|
| 51 |
-
| `wiki_search` | Fetch Wikipedia articles and summaries |
|
| 52 |
-
| `add`, `subtract`, `multiply`, `divide`, `power` | Basic arithmetic operations |
|
| 53 |
-
| `analyze_excel_file`, `analyze_csv_file` | Parse spreadsheets and compute statistics |
|
| 54 |
-
| `analyze_docx_file`, `analyze_pdf_file`, `analyze_txt_file` | Extract and summarise document content |
|
| 55 |
-
| `vision_qa_gemma` | Answer questions about images using a vision model |
|
| 56 |
-
| `safe_code_run` | Execute Python code securely in an isolated environment |
|
| 57 |
-
|
| 58 |
-
These tools are loaded into a `ToolNode` and passed to the agent for use during execution.
|
| 59 |
-
|
| 60 |
-
### 📝 Comprehensive reporting & critique
|
| 61 |
-
|
| 62 |
-
After the agent finishes, a deterministic LLM generates a structured execution report.
|
| 63 |
-
This report summarises the query, steps taken, key findings, sources used, and the final answer.
|
| 64 |
-
A separate **critic** LLM evaluates the report for completeness, accuracy, methodology and evidence, scoring it out of 10 and suggesting improvements if necessary.
|
| 65 |
-
The system may then replan and re‑execute until the answer meets quality thresholds.
|
| 66 |
-
|
| 67 |
-
## 🏗 Architecture
|
| 68 |
-
|
| 69 |
-
Ankelodon is built as a directed acyclic graph of nodes. The high‑level flow is:
|
| 70 |
-
|
| 71 |
-
1. **INPUT** – Receive the user query and optional files.
|
| 72 |
-
2. **COMPLEXITY_ASSESSOR** – Classify the query as simple, moderate or complex and decide whether to plan.
|
| 73 |
-
3. **PLANNING** – Generate a multi‑step plan when needed, using examples and strict rules about tool usage and numerical computation.
|
| 74 |
-
4. **AGENT** – Iterate through the plan: reason about each step, call a tool, capture results and update state.
|
| 75 |
-
5. **TOOLS** – Execute selected tools via a unified `ToolNode`.
|
| 76 |
-
6. **FINALIZER** – Consolidate the execution into a report and extract a formatted final answer.
|
| 77 |
-
7. **CRITIC** – Score the report and decide whether to accept or trigger the **REPLANNER**.
|
| 78 |
-
|
| 79 |
-
The graph is compiled using LangGraph’s `StateGraph` API and is flexible enough to be extended with new nodes or tools.
|
| 80 |
-
|
| 81 |
-
## 🚀 Getting started
|
| 82 |
-
|
| 83 |
-
### Prerequisites
|
| 84 |
-
|
| 85 |
-
This project targets **Python 3.11+**. You’ll need API keys or credentials for any external services (e.g. OpenAI, Tavily, Gemini) used by tools.
|
| 86 |
-
Assuming you have a virtual environment activated:
|
| 87 |
-
|
| 88 |
-
```bash
|
| 89 |
-
pip install langchain==0.1.* langgraph openai google-generativeai
|
| 90 |
-
# plus any other packages referenced in tools (pandas, numpy, pillow, tldextract, etc.)
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
### Running a simple query
|
| 94 |
-
|
| 95 |
-
The entry point is the `build_workflow` function in `src/agent.py`. It returns a compiled system you can invoke with a dictionary representing the agent state.
|
| 96 |
-
A minimal example:
|
| 97 |
-
|
| 98 |
-
```python
|
| 99 |
-
from src.agent import build_workflow
|
| 100 |
-
|
| 101 |
-
# Initialize the graph
|
| 102 |
-
system = build_workflow()
|
| 103 |
-
|
| 104 |
-
# Build the initial state
|
| 105 |
-
state = {
|
| 106 |
-
"query": "What is the square root of 144?",
|
| 107 |
-
"messages": [],
|
| 108 |
-
"files": [],
|
| 109 |
-
"iteration_count": 0,
|
| 110 |
-
"max_iterations": 3
|
| 111 |
-
}
|
| 112 |
-
|
| 113 |
-
# Invoke the system and get the result
|
| 114 |
-
result = system.invoke(state)
|
| 115 |
-
print(result.get("final_answer")) # should output: FINAL ANSWER: 12
|
| 116 |
-
```
|
| 117 |
-
|
| 118 |
-
For more complex tasks involving file uploads or web searches, provide file paths in the `files` list and ensure appropriate API keys are set in the environment.
|
| 119 |
-
|
| 120 |
-
### Notebooks & examples
|
| 121 |
-
|
| 122 |
-
There are example notebooks under `src/` and `test_folder/` demonstrating how to test the agent with sample queries and data.
|
| 123 |
-
Feel free to explore and adapt them to your own scenarios.
|
| 124 |
-
|
| 125 |
-
## 🛣 Roadmap & GAIA adaptation
|
| 126 |
-
|
| 127 |
-
- Integrate unit conversion, date arithmetic and table operations to handle GAIA evaluation tasks out‑of‑the‑box.
|
| 128 |
-
- Add question‑clarification and error‑recovery loops to minimise unnecessary replanning.
|
| 129 |
-
- Streamline the tool list by removing unused tools and grouping related operations.
|
| 130 |
-
- Improve caching of external calls (e.g. web search, downloads) to speed up repeated queries.
|
| 131 |
-
- Expand the test suite and add continuous integration.
|
| 132 |
-
|
| 133 |
-
## 🤝 Contributing
|
| 134 |
-
|
| 135 |
-
Contributions are welcome! If you find a bug or have an idea for improvement, feel free to open an issue or a pull request.
|
| 136 |
-
When adding new tools or nodes, please ensure they adhere to the structured planning and execution patterns shown here, and update the tests accordingly.
|
| 137 |
-
|
| 138 |
-
## 📄 License
|
| 139 |
-
|
| 140 |
-
This project is released under the MIT License. See `LICENSE` for details.
|
| 141 |
-
|
| 142 |
---
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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