Episode Transcript
Available transcripts are automatically generated. Complete accuracy is not guaranteed.
(00:05):
You are listening to the BreaktimeTech Talks podcast, a bite-sized tech
podcast for busy developers where we'llbriefly cover technical topics, new
snippets, and more in short time blocks.
I'm your host, Jennifer Reif, anavid developer and problem solver
with special interest in datalearning and all things technology.
(00:25):
This episode is apparentlygoing to be all about agents.
It wasn't intended that way, but that'swhere my exploration has led me this week.
After running into issues trying todo GraphRAG with Spring AI advisors,
I started turning to tool calling,which is often used synonymously
with agentic functionality.
I'll explain how things went on that,plus a few other updates, and then jump
(00:48):
into a content piece that was releasedthis week about building agents in Java.
Let's go.
First on the agenda is to talk about myexperience with Spring AI tool calling.
I have both a vector search andgraph retrieval as tools, and the
example is available on GitHub.
I'll talk a little bitabout that in just a second.
I mentioned last week that I wasstuck on advisors, and I've taken a
(01:11):
few more stabs at that functionalitythis week with no success just yet.
But while I'm noodling onthat, I went ahead and dug
into tools just a little bit.
I've talked about agentic frameworksbefore, or age agentic workflows before.
You can see episode 35 fora bit more detail on that.
But just as an overview, they aretypically where you expose a few
(01:32):
different paths for a large languagemodel to take in order to answer a
question or solve a problem coming in.
As an example, someone might askabout information on a company, and
the application or the large languagemodel will decide whether to run a web
search, query a database, and/ or builda customer profile with sales data.
They can retrieve data or takeactions, and agents can vary on
(01:55):
a scale of following a preciselydefined workflow, series of steps,
all the way to making decisions andpretty much operating autonomously.
Going back to my example, though,I do have a working example in
my springai-goodreads repository.
I will save a link tothat in these show notes.
And I have two differenttools that operate.
One is a vector search tool, and thenthe other is a graph retrieval tool.
(02:20):
So I have that same workflow thatI've been working on where I have a
vector search and then a graph querythat runs on top of that to pull extra
relationship and related information.
And I have this vector graph process,and I need to execute both tools.
I was a little bit worried whenI put in this tool functionality
about consistency, whether the largelanguage model would decide to use a
(02:44):
tool or both tools or not entirely.
But so far, I've had good results.
It's run everything that I needed it to.
It's consistent, executing both the toolsthat I need in order to retrieve the data.
And there's not a lot ofmanual mapping or boilerplate.
The large language model can infer what'sneeded and how to transform the input,
(03:04):
with a little bit of minor preparation.
I will add, you still have to do alittle bit of deserializing JSON.
To back up and explain that a little bit,both tools and advisors will pass data and
context using JSON formats, so you oftenend up dealing with deserialization of the
JSON in order to pass or parse differentcomponents of that that you might need
(03:25):
as output and input for various tools.
But the alternative is to do all thatmapping and steps manually, as I've done
in my manual GraphRAG approach, which ison the main branch of that repository.
And I still feel like this is a betterway just dealing with a little bit of
deserializing JSON, and passing stuffthan doing it all of it manually.
You trade one inconvenience foranother, but the auto configure
(03:48):
does make less boilerplate ontools and the tool calling itself.
So that's the overview of tools.
You can check out the repositoryfor all of the updated code.
It's also sitting on Spring AI 1.0,so everything should be current there.
I feel like I've just scratched thesurface on this tool and age agentic types
of functionality and applications though.
(04:09):
So I hope to explore and do alittle bit more in depth research
and playing around with it to seewhat else there is and other things
that I might be able to add to it.
I also, though, updated the main branchof that same repository to Spring AI 1.0.
So you can look at the manual GraphRAGapproach using Spring AI 1.0, and then
(04:29):
look at the AI tool branch for the toolcalling and stuff, also sitting on 1.0.
If I can get an advisors sectionworking... I haven't found a way to get
a clean version of the vector searchresults into the graph retrieval query
without creating a lot of boilerplate,which was kind of the whole idea for
going to the advisors was to try toavoid the boilerplate in the first place.
(04:51):
But if I can get that working, thatwill also be sitting on Spring AI
1.0, so everything should be up todate and consistent there, assuming
I can get all the pieces in place.
Then the content piece that Icame across this week was just
released earlier this week.
It's called Agentic AIwith Java and Neo4j.
I was really excited to see apiece of Java and AI content out
(05:12):
there, and it's also from someoneat Neo4j, which is even better.
Thank you Christoffer Bergman forwriting this and publishing this.
The author makes a differentiationbetween GraphRAG or traditional GraphRAG,
if you will, and agentic GraphRAG.
For instance, agentic GraphRAG, accordingto the article, is where large language
model decides how to traverse the graph.
(05:34):
Where traditional GraphRAGis a set pattern or query in
order to answer the question.
So in agentic, the model, largelanguage model determines what
kinds of patterns and what kindsof Cypher it needs to construct in
order to help answer the question.
And traditional GraphRAG is goingto be almost a hard coded query that
it's gonna use to answer differentquestions using that same query.
(05:55):
Initially, text2cypher didn'treally entice me that much.
I felt that giving the LLM free reignto create and run Cypher queries seemed
fraught with peril and pretty buggy.
But as I've explored and seen more andmore use cases, one is also outlined in
this article, I'm seeing that text2cyphercould be extremely invaluable when
(06:16):
you're not sure what all questionswill get thrown at the application.
If you don't want a lot of "I don'tknow" answers, for instance, then
text2cypher would at least try to makean attempt at solving the problem.
And of course, you would need to lock itdown with permissions and read only and
traversal, RBAC procedures and so on.
But this opens up the opportunityfor answering more questions and
(06:40):
more broader applications than justa hard coded set pattern query.
The article starts by explaining thebackground of the project and the steps
that have been done previously and thenjumps into this post's agentic component.
First, it starts by registering the agent.
This example uses OpenAI as the modelof choice, but also says there are
(07:00):
plenty of other models to choose fromthat will work perfectly well here.
And actually, I didn't realize youneeded to register an agent, and later
in the article it shows you how todo this programmatically too, so you
don't have to go through the UI if youdon't want to to register your agent.
Then the article walks throughsetting up the Java library to execute
and manage the agent and tools.
(07:20):
This is basically the agentic framework,if you will, and the author walks
through creating this manually soyou understand what's going on under
the hood of these AI frameworks.
I find this really fascinating andkind of interesting as well, just to
know what other frameworks are doingthat we don't see under the hood.
The article closes by saying thatthis example should be used as a way
(07:42):
to demonstrate how agentic AI works,not as a production grade library.
So this is for demo purposes only,that he has constructed this library.
We, again, so we can see under thehood of how frameworks operate.
It includes a list of things thatthe library would need before being
considered production ready, and insteadof doing all of that, recommends other
(08:02):
existing solutions for production readyframeworks that are already there.
Today, we focused everythingaround agents, my exploration and
the content that I came across.
I discussed my exploration of runningGraphRAG with Spring AI tools, using tools
for vector search and graph retrieval.
And then I walked through anarticle for how Christoffer Bergman
(08:22):
at Neo4j built a demo libraryfor agents with Java and Neo4j.
Thanks for listening and happy coding.