Skip to main content

Building tools that use AI by building tools that AIs use.

Project description

Daring Mechanician

The Daring Mechanician project provides several Python packages for building Generative AI-enabled applications where the AIs themselves are provided tools to use, an approach that can be described as Tool Augmented Generation (TAG), and the tool-wielding Generative AIs can be described as Tool Augmented Generative AIs (TAG AIs).

The core mechanician package provides modules for building, testing, and tuning TAG AIs and the tools that these AIs use, including support for AI-driven testing and AI-assisted tuning of the instruction sets given to an AI that we call Instruction Auto-Tuning (IAT).

The mechanician-openai package provides AIConnectors for both OpenAI's Chat API and Assistants API, and there are plans to create connectors for more LLMs with tool-call support, especially local LLMs.

The mechanician-arangodb module provides AITools that let AIs interact with the ArangoDB graph database.

Tool Augmented Generation (TAG)

Foundation Models are inherently limited by the scope of their training data and the static nature of that data, Tool Augmented Generation (TAG) provides AIs with tools that let them interact with databases, APIs, and code libraries, enhancing their knowledge and capabilities and giving them access to up-to-date information, the ability to perform computations, and to interact with external systems, and can provide them a form of memory that spans multiple context windows, like what OpenAI announced here.

In contrast to Retrieval Augmented Generation (RAG), which uses a knowledge base to retrieve information and augment the prompt sent to an AI, Tool Augmented Generative AIs can retrieve information themselves, and also perform actions across multiple systems, databases, and APIs, extending Generative AIs from pure knowledge repositories to active participants in information processing and generation.

NOTE: You can build a RAG application using a TAG AI to create a RAGTAG AI Application.

TAG leverages the "Function Calling", or "Tool Calling", capabilities available in several Large Language Models, including OpenAI's GPT, and is meant to complement other approaches to augmenting Foundation Models, like Retrieval Augmented Generation (RAG) and Fine Tuning (FT).

Designing Tools for AIs to Use

TAG AIs can be observed performing multi-step problem solving, driven by the feedback provided by their tools, and learning to use those tools effectively through that feedback, so it is necessary for the tools to provide effective feedback, often through natural language, when reporting errors or providing results.

Generative AIs will learn from their mistakes and successes, if the tools provide feedback that the AI can learn from.

See Getting Started with Daring Mechanician for an example of how to build a Tool Augmented Generative AI (TAG AI).

Instruction Tuning (IT)

In addition to learning from the feedback provided by the tools they use, TAG AIs can learn from the feedback they receive from users.

But since TAG AIs do not necessarily undergo further training, or Fine Tuning, that permanently encodes what they learned, they can only learn within the context window where feedback is received, and must start from scratch during the next session.

In order to make these learned behaviors persistent, they must be captured through a process of Instruction Tuning, or prompt engineering, where the initial instructions provided to the AI, the instructions provided for the tools the AI can use, and the feedback provided by those tools are revised and improved, incorporating lessons learned during interactions with users.

This process starts with creating an initial set of AI Instructions, Tool Instructions, and Tool Feedback, that are used to guide the AI's behavior and responses, and then iteratively refining those instructions and tool feedback based on the AI's performance during interactions with users.

At the start of this process, the prompting provided to the AI often consists of explicit and detailed steps, but as the process proceeds, you sometimes discover that the AI doesn't need such detailed prompting, and that more general prompting approach can be used, letting it will work out the details on its own, and other times you discover the reverse where the AI makes incorrect assumptions, and more explicit prompting is required.

In order to speed up this process, it is useful to use an Evaluator AI that acts as an user surrogate, interactively eliciting responses from the AI as the two work through multi-step tasks. See Getting Started with AI-Driven Testing for more information on Evaluator AIs.

Instruction Auto-Tuning (IAT)

By observing an AI's interactions with users and other AIs, an Instructor AI can refine and update the AI's current instructions and the instructions describing the tools the AI can use.

The Instructor AI is given the AI's current set of instructions, instructions for the tools used by the AI, and the transcript of interactions between the AI and a User (or Evaluator AI), including the AI tool calls and responses.

See Getting Started with Instruction Auto-Tuning for an example of how to use the Instruction Auto-Tuning (IAT) process to refine the instructions for a Movie Database Assistant.

AI-Driven Testing

See Getting Started with AI-Driven Testing for an example of how to use the AI-Driven Testing process.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mechanician-0.1.3.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mechanician-0.1.3-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file mechanician-0.1.3.tar.gz.

File metadata

  • Download URL: mechanician-0.1.3.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for mechanician-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ea53db2a51d08217ea628083b3cd92a7d83da6a84a43a173e7f368570a2dfd70
MD5 18a2b9a1531c687e757ee3813cb63392
BLAKE2b-256 b52a70af9a075af347867a7882421c3bc21ae421f5b9b8e91435ec687ee08a3b

See more details on using hashes here.

File details

Details for the file mechanician-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mechanician-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for mechanician-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5eb320647f2f78871496adddc9529a872a448549a5fca1d8dffe6b92ef08563f
MD5 f714cd85b2e991c846dc4f3b6b2633c6
BLAKE2b-256 6105c6542307997ff675c244ff590dc7b0246138f3967393dcedcfeeecf47486

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page