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 Wright, anavid developer and problem solver
with special interest in data,learning, and all things technology.
I'm at a conference this week presentingon a variety of different topics,
(00:28):
but I stopped for just a few minutesto document some recent learnings
while I was preparing the codeprojects for this week's sessions.
I'll chat about a hands-on experiencethat helped me understand why
embedding models for vectors andsearch should actually match.
Then I came across an article withadvice for creating a blog that
outlines a lot of the practices Imyself follow when I write tech blogs.
(00:50):
I hope you enjoy it as well.
The first thing I wanted to talk aboutis embedding models need to match
when you are creating the embeddingsand then when you're searching them.
I had heard this before, I think ata conference last summer, that when
you use an embedding model to createembeddings for the data in a database,
and then when you try to search thoseembeddings, you should use the same model
(01:14):
or at least the same model family.
I found out how true this actuallywas with a real life example.
Now, I was already using the sameembedding model family because
I was using OpenAI's models.
I think it was 002-text-adaand the 3-text-small models.
(01:35):
But what I was tryingto do...the Pinecone
vector embeddings...
So I was trying to save datainto Pinecone and create vector
embeddings to the database.
And then I was trying to do basicallythe same thing with Neo4j as well.
And one model was default forone database and another model
was default for another database.
Again, both using OpenAI modelfamily, one was using text-ada-002,
(01:59):
one was using text-3-small, I believe it was.
And I just went with the default models,
they were OpenAI, looked good,and created the embeddings.
And then when I tried to search,it would not find results for one
or the other in my application.
So my application had a default model setas well for OpenAI, and I believe
(02:20):
I set it for the text-3-small,which matched Pinecone at the time,
what I'd embedded Pinecone data in.
And when I would try to search,it pulled those results back.
But then when I would try to searchNeo4j, which Neo4j used
the ada-002, and my applicationused 3-small. And I would try
to query Neo4j, and it wouldn'tretrieve anything or retrieve garbage.
(02:42):
And so then I flipped the model of myapplication to use ada-002 and thought,
well, okay, I'll try it this way and, andsee if, Neo4j is just being picky.
And then I queried data with Neo4j,and Neo4j data retrieved great.
But then I tried to use the same queryagainst my vector store in Pinecone.
And it didn't, the, the modeldidn't match, and it didn't
retrieve anything good either.
(03:03):
So it wasn't the database.
It's really the embedding andthe, the vector representation
between the models is so different.
When I went back and recreatedthe, the data in each database
using the exact same model,
then did a vector similarity search frommy application using the exact same model,
then I was able to get good resultsfrom both databases with no problem,
(03:26):
but all of my models had to align.
I had to create the embeddings in Pine-cone with text-3-small OpenAI.
I had to create the vector embeddingsin Neo4j with the model OpenAI
text-3-small, and from myapplication, I had to query vectors
using OpenAI text-3-small.
So all of those needed to matchin order for me to retrieve
(03:47):
anything of value with that.
Even with different databases, youstill can get slightly different
results, even when all of yourmodels match, like my case did.
There were still a few instanceswhen I would send a query
to Neo4j, to Pine-cone, again, all three
now on the same model.
And I would get slightly differentresults coming back from the
(04:09):
vector similarity search.
And this is the way that eachvector database will implement
vector similarity search.
It's gonna be slightly differentfor every database, right?
Because every database isslightly different in the way
they store and retrieve data.
And every database engineer is gonna havemaybe a slightly different flavor for how
they might want to optimize those queries.
So again, every implementation of everydatabase, vector similarity search
(04:32):
might be just a little bit different.
Even taking the exact same data set, theexact same embeddings to store in there,
and using the exact same query to querythose vectors in the database, you still
might get slightly different resultsjust because your database is different.
Just to be aware of that. This was, again,a case that I had to see firsthand
(04:55):
with my own data and my own experiencein order for me to understand what
was going on and see, oh, it, thisreally does make a difference.
There's a lot of variables whenyou're talking about AI, and
this really is no different.
Just more to add to the, to the mix.
I also came across an article that reallyresonated with me because I really love to
tech blog, and it was an article that'scalled Advice for a Friend Who Wants
(05:18):
to Start a Blog. And I thought thiswas really great for anyone interested
in starting their own blog, whetherthat's technical blog or something else.
It can apply to lots of differenttopic matters and subjects.
Think like code projects or librariesor hobbies or anything general.
Right?
But I really thought thiswas cool for tech blogging.
It follows a lot of the methodologiesthat I use for tech blogging.
(05:40):
First, I'm just gonna cover a few ofthe examples and advice suggested in
the article that most resonated with me.
But feel free to check outthe article for the full list.
The first one is to write for yourself.
Find out what's interesting, what youlearned. That's gonna make your content
unique because it's your learning journey.
And hopefully somebodyelse resonates with that.
(06:01):
Maybe they came across the same stumblingblocks or they perceived topics or
concepts the same way that you did.
And maybe they'll haveother differences, right?
But something in there might helpresonate with somebody else as well.
So code, write
blog posts for yourself.
And I like to use tech blogging asalmost a referencing, documentation,
(06:23):
dictionary for later becausewhen I come across a problem I,
I solve that problem.
And then as is typical, you kindof move on and do something else.
Well, then you might run across thatproblem later on down the road and you go,
ah, I can't remember what I did with that.
Then you're stuck looking throughlocal documents or code repositories,
or you're going out to GitHub anddigging and searching through things.
(06:45):
How did I approach this problem?
And maybe you find the solution,but you don't remember how you went
about getting to that solution orwhy you used that solution versus
maybe six other solutions.
Right?
So I like to tech blog because itdocuments my thought process, how I went
about finding the solution to the problem,maybe resources where I uncovered the
(07:07):
solution or located it or put piecestogether from multiple solutions in order
to get a working piece of code or togo about the problem in a certain way.
I see this as almost self documentationfor me to reference later in case
I come across the same problemagain. I remember how I solved it
and why I went about it that way.
Now, of course, hopefully that's helpfulto others and a broader audience too.
(07:30):
But I really love to use it as a selfdocumentation type of exercise, I guess.
The second thing is that the articlementions is to be yourself in your writing
and approach writing in a chat like style.That's gonna make you more relatable.
If you think about when you talkto somebody on the street or at
a conference, it's very casual.
(07:53):
It feels very natural and organic.
The conversation, even if you'retalking very technical topics, right?
When you do the same thing in a blogpost, it feels very relatable, very
conversational, very casual. Andyes, you wanna avoid too many casual,
maybe unprofessional orinappropriate things, right?
You want, you want to have some level andsome boundary of professionalism in your
(08:16):
writing. But to some degree, you alsowant it to feel very natural and very
interesting to the average person, right?
Whether you're experienced in thatparticular technology or you're
not, or you're just learning or youhave some, some experience, but maybe
you need some background on some ofthe concepts and to come across very
here's what I learned,here's how I went about it,
(08:37):
here are the steps that I took.
It's pretty easy for anybody tofollow along with that conversation.
And even if it's somebody doesn'tagree with your methodology, they
might be able to understand, oh,here's how this person got to this.
I can kind of see that.
Alright, no big deal.
It's also a little bit less threateningand a little less intimidating for
somebody who's coming across your work,whether they're experienced or not.
(08:59):
I really enjoy this type of writing andit also makes it fun and interesting
for me to reread because again, itfeels very natural and what I was
thinking and feeling at the time.
I also really like the article'spoint to plan and edit your writing.
This kind of goes against, I guess,the last bullet point, if you wanna
think of it like that. But I don't
(09:19):
over-structure my contentbefore I write it.
But I do kind of have a general idea.
And the way that I actually really liketo approach this is I'll usually work
on a code project or deal with a certainproblem and find the solution or put
together a presentation or something.
And there's always something that Ilearn or that I didn't realize or a
(09:40):
roadblock that I had to figure outhow to go around or to break through.
And those struggles are usuallywhat I like to document.
Because of that, because I'm pickingcontent I've already worked through, that
kind of does a lot of the outlining forme because I already have a process for
how I went about solving that problem.
Things that I researched, thingsthat I tried that didn't work, until
(10:03):
I finally got to a working solution.
That helps me outline.
And then there's a little bitless work when I write my content,
at least because it's usually,here's how I solve the problem.
Here is my process for that.
So a lot of the planning, editing,outlining is already done for me because
I've already worked through that oncewhen I actually solved the problem.
(10:23):
The last point that I want to highlightout of this article is that digital
content will allow people to pick andchoose the pieces they find interesting
or valuable, and then close thetab when they're not interested or
when they've gotten what they need.
This I found really cool becauseinstead of standing up in a room
and presenting to a crowd or
talking to somebody andinstructing them through something.
(10:45):
Digital content allows people to pickand choose what they find interesting. And
this also works for me, self-referencingmy own documentation, right? When I come
back and try to solve the problem again,I don't necessarily need to read the whole
thing from top to bottom and understand mythought processes from beginning to end.
I'm really just looking maybe forone little piece of how to solve
the problem or why I did it thisway. I'll find a little bit that
(11:07):
applies to my situation now or thething that I need, and then I get
that piece and I drop back out again.
I find this super helpful for me,myself, on my own content, let alone
hopefully for somebody else too.
Digital content makes it very accessiblefor people to pop in, get what
they need, and then step out again,and then do the same thing later.
Again, when they run into that problemor they're trying to explain it to
(11:28):
somebody else, or somebody else ishaving the problem, they're like,
Hey, check out this piece of content.
It might have what you need.
This is what I love about digitalcontent, tech writing, tech
blogging, tech podcasting,tech video making, and so on.
It allows people to just get in, getwhat they need, and get out without really
worrying about offending somebody forpopping in and leaving a talk or being
(11:51):
rude and saying, cut to the chase,
I really just wanna know about this.
So I like this almost anonymous,
a little bit more efficient maybe,when you're trying to learn.
Now, of course, there are some thingsthat you can't replace a one-on-one
conversation or sitting down withsomebody and watching them code or
pair programming on, on a problem.
But I think in a lot of cases thatthis, this digital content provides
(12:14):
a different medium in order to learnand be productive in different ways.
Also, I'm gonna leave with just a thoughtthat I thought this article overlapped
really well with, and something thatI've learned through my own tech
blogging process, and a colleagueonce told me to write the content
that I struggle to find the answer to.
When you go out to Google or you goout to any other type of search engine,
(12:36):
you try to look to solve a problem.
Maybe you can't findcontent that you need.
Write that content so that the nextperson coming along and struggling
with the same thing or very similarthings has something to reference.
And that's you included, right?
You come back across that problem, ah,there's still nothing on Google for,
for the problem I'm trying to solve.
Write that content and fill in thosegaps so that way hopefully you or
(12:57):
somebody else can benefit from that.
It's gonna help fill the gap and hopefullyhelp the next person down the road.
This week, I talked through my hands-onexperience of what happens when
embedding models for creating vectors andsearching them don't match, and why it's
important to align those models for both.
Then I highlighted some advicefrom an article for starting a blog
(13:17):
that applies to tech blogging aswell, and that I consistently use.
Thanks for listening and happy coding.