0xPlaygrounds / rig

A library for developing LLM-powered Rust applications.
https://rig.rs
MIT License
81 stars 3 forks source link

feat: Merge the `Model`, `Agent` and `RagAgent` types into single `Agent` type #12

Open cvauclair opened 2 weeks ago

cvauclair commented 2 weeks ago

Feature Request

Merge the Model, Agent and RagAgent types into a single Agent type.

Motivation

The Model, Agent and RagAgent types currently all work the same under the hood. The only difference between all of them is the amount of configuration each type supports, from least configurable (Model) to most configurable (RagAgent). In other words, an Agent without defined preamble, context or tools is equivalent to a Model and a RagAgent without defined vector stores is equivalent to an Agent.

Merging those types into a single, highly customizable Agent type would improve the developer experience and reduce code repetition.

Proposal

Alternatives

Another solution could be to have a RAG system type be parametrized by any other type that implements the Prompt and/or Chat trait (e.g.: and Agent type). However, this would mean that there are two toolsets (one for the RAG system and the other for the underlying Agent) which complicates tool calling.