taiat is a tool for managing dependencies in AI agents
Project description
taiat
Three Agents In A Trenchcoat (Taiat) is a tool built on top of Langgraph to make building dependency graphs among agents even easier. It takes a series of agents, the expected outputs and needed inputs of each, and then executes workflows specifically to produce a desired output. With the addition of a tool to select desired outputs from a natural language query, this can be a full solution for question answering with an agent workflow.
Overview
Taiat can take:
- a series of defined agents, with name, parameters (which can represent constraints), descriptions, and associated agent functions
- a query from a user (e.g. "Train a regression model on the diabetes dataset, and summarize the results.")
- an output processor that turns user queries into a selection of input data and desired outputs
- an LLM API
... and produce an agent graph that will run all necessary agents, including any dependencies for the desired outputs.
Agent Graph
Taiat creates two different types of graphs:
- The TaiatBuilder
build()method creates and returns a full node dependency graph, where each node is an agent, and each edge is a dependency. This graph can be run in the case that all outputs must be produced. The graph is traversed to execute the agents in the correct order. - The TaiatBuilder
get_plan()method creates and returns a specific plan subgraph to produce one or more desired outputs. This subgraph will be pruned to only produce inputs necessary for the specified outputs. This is generally the approach an agent will want to use to answer specific queries.
The primary difference between TAIAT and standard Langgraph is that TAIAT allows for the specification of constraints, such that each agent will be run when its dependencies have been satisfied - specifically, that inputs to the agent have been produced by agents that provide them as outputs. The selection of next task is handled by the TaiatManager, which looks for unfulfilled dependencies and selects the next agent to run to fulfill them.
Graph Visualization
Taiat supports visualizing the dependency graph using Graphviz. To enable visualization:
- Set
visualize_graph=Truein yourTaiatQuery - The
TaiatEngine.run()method will return a tuple(state, visualization)wherevisualizationcontains the DOT source code - You can save the DOT code to a file and render it using Graphviz
Example:
query = TaiatQuery(query="your query here", visualize_graph=True)
result = engine.run(state)
if isinstance(result, tuple):
state, visualization = result
if visualization:
with open("graph.dot", "w") as f:
f.write(visualization)
# Render with: dot -Tpng graph.dot -o graph.png
See examples/visualization_example.py for a complete example.
Query Database
There is a simple postgres implementation of a query/output DB interface for collecting query data and saving outputs, e.g.
db = PostgresDatabase(session_maker=self.session_maker)
db.add_run(TaiatQuery( ... ))
See tests/db.py for an example.
Example
To use Taiat, provide a series of agents, a query, and an output processor. A simple example is in the examples/ folder, which contains an agent that will perform various kinds of analyses on Kaggle CVS datasets. It can be tested on the command line with
python taiat/examples/ml_workflow.py --request="<request here>". Give it queries such as:
Perform clustering on the points in the Pima dataset.
Give me a report on the results when you train a nearest neighbor classifier on the iris data.
and the agent will perform all relevant tasks, including (if appropriate for the request) downloading the data, performing a train/test split, performing the appropriate processing upon the dataset, performing an evaluation, and providing a summary of results. (Note that this requires access to both the OpenAI API and the Kaggle API, in its current implementation.)
Note
This is pre-alpha software, and to put it lightly, some things are missing. Specifically:
- There is not a canonical approach to deal with multiple possible dependency fulfillments; if two agents can both fulfill the requirements of a dependency, it's currently an arbitrary choice.
- Parameter resolution is not rigorous (currently, we assume well-formed parameters that represent constraints and just look for matching supersets).
Project details
Release history Release notifications | RSS feed
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 taiat-0.0.2.tar.gz.
File metadata
- Download URL: taiat-0.0.2.tar.gz
- Upload date:
- Size: 30.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
152cd3d5cf755763c5701f4a1b7e81c71997dec19e9e3691d38e53be6b376755
|
|
| MD5 |
2417c68927bf74a65f4f3c747284b8ed
|
|
| BLAKE2b-256 |
3b73d38e3ed02e5009ae02833333b21a0254f5ba77d35b39d764247650755dc2
|
File details
Details for the file taiat-0.0.2-py3-none-any.whl.
File metadata
- Download URL: taiat-0.0.2-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
810c2f60e8d0df10768ebe9fb14c83c364ccb61035876a91f1813fe3ca46f147
|
|
| MD5 |
511e59aac4708b0cfa8bcdedf8766673
|
|
| BLAKE2b-256 |
d7e725aa8380e0304f8859fb5e4e6196a114554b186febff93f3593b61425110
|