A pretty huge release for Swiftide 🎉, 0.16 allows you to build AI agents in Rust. You know, that seemingly hot AI thing everybody talks about, with promises of doing it all for you.
I’m a bit more optimistic, I think we just are not there yet. And when doing agents, performance and reliability suddenly really start to matter. At the same time, the space is moving extremely, ridiculously fast, so we need building blocks to keep innovating at the same pace, and not get stuck on infrastructure (or lifetime) issues.
I think with this release we put a step forward in doing exactly that.
Swiftide is a Rust library for building LLM applications. Index, query, run agents, and bring your experiments right to production.
To get started with Swiftide, head over to swiftide.rs, check us out on github, or hit us up on discord.
Agents!
In intelligence and artificial intelligence, an intelligent agent (IA) is an agent that perceives its environment, takes actions autonomously in order to achieve goals, and may improve its performance with learning or acquiring knowledge.
— wikipedia
There are quite a few agent libraries and frameworks out there, most in Python. Many of them are monumental efforts and should receive all the praise for charting unknown territory. And also in Rust, there are several solutions.
So today we would like to pitch something new:
- Building blocks with minimal abstractions
- Iterate on building an agent, not the underlying infrastructure
- Easy to add lots of tools
- … and of course super fast <3
In Swiftide, you have agents, agents have a context, and an agent can execute tools in that context. One of the exercises we did is take a bunch of different agent models, and see if we can implement them in Swiftide, and so far we haven’t found anything concept breaking.
Here is an example of an agent that will use ripgrep to search code:
What I think is really cool, is that you can mix and match with pipelines, run agents from other agents, or otherwise go wild. Rust provides a lot of primitives to do this effectively, and Swiftide does not limit on that.
To learn more about agents, check out swiftide.rs, the api documentation, or hit us op on discord and we’d love to help.
Currently the ChatCompletion
trait is only implemented for OpenAI, but in no means tightly coupled to any particular LLM, more to follow and contributions welcome.
Analyzing, debugging and improving an agent is also straightforward with OpenTelemetry
.
p.s. you can find a docker tool executor on our github.
PGVector support
Shoutout to @shamb0, we now have indexing and retrieval support for pgvector, combined with sqlx.
Check out this example to learn more.
Documents as first class citizens in retrieval
In retrieval documents will now eagerly include any indexed metadata as well. A good example here is that if you have lots of small chunks, having the path available can be very impactful for the generated context. In addition, the default answer step can now take an optional template for rendering documents.
This creates several nice future opportunities for reranking, multiple and staged retrieval.
Documentation updates
swiftide.rs has had a large pass on documentation, trying to bring everything in sync. A lot more has been added on agents. More is still in the pipeline. If you feel something is still missing (I know I do), feel welcome to reach out.
Call for contributors
There is a large list of desired features, and many more unlisted over at our issues page; ranging from great starter issues, to fun, complex challenges.
There are many, many changes since our last update, check out the changelog here.
To get started with Swiftide, head over to swiftide.rs or check us out on github.