Welcome to The Memory Library
Where AI remembers meanings, not just exact words.
Enter The LibraryMeaning cluster ยท furniture
These words all live close together in AI memory.
Why Exact Words Fail
Old-style systems search for exact letter matches. If the word isn't there, the shelf stays empty.
The Problem
โCouchโ and โsofaโ mean the same thing โ but a keyword system treats them as completely different.
The Solution
Embeddings teach AI to recognise meaning โ not just spelling.
Humans understand meanings โ not just exact spellings. Wouldn't it be magical if AI could too?
Meaning Neighborhoods
The Memory Library organises words by meaning, not alphabet. Similar ideas live in the same neighbourhood โ no matter how they're spelled.
In the Memory Library, words aren't filed alphabetically โ they float near the words they feel like.
Meet Popy
Your guide through the Memory Library โ the AI librarian who organises thoughts by meaning.
Popy
Semantic Librarian ยท District 6
The Semantic Galaxy
Every word becomes a glowing star floating in a meaning galaxy. Related words drift close together โ like planets in the same solar system.
Each word becomes a coordinate in meaning-space. Similar meanings have similar coordinates โ so they land near each other!
Search By Meaning
The Memory Library doesn't need exact words. It finds the closest meanings. Pick a query and watch the semantic search light up.
How AI Fetches Memories
RAG โ Retrieval Augmented Generation โ means AI looks up relevant memories before answering. Like a student who reads notes before the exam.
Tourist asks: "Where can I relax in Jaipur?"
Converts the question to a meaning coordinate and scans the library.
Nearest documents fly off the shelves: spa guides, lounge reviews, recliner cafรฉs.
The AI worker reads the retrieved documents โ getting rich, relevant context.
"Try Anokhi cafe's rooftop lounge or Dera Mandawa spa โ both are very relaxing!"
RAG helps AI fetch useful memories before answering โ like checking the library shelves before writing an essay.
Embeddings in Code
Two lines. That's all it takes. Hover the glowing words to reveal what each piece does.
The AI never stores raw text in a vector database โ it stores meaning coordinates (the embedding). Searching those coordinates is how semantic similarity works.
Mission: Build AI City's Tourism Memory
Tourists are arriving and the Memory Library shelves are mixed up! Sort each word into its correct semantic neighbourhood โ and watch AI City come alive ๐
Build your first semantic memory ๐
Four steps. From raw text to a searchable meaning-library in minutes.
- 1
Install the libraries
Grab OpenAI for embeddings and a vector store client.
pip install openai chromadb
- 2
Create an embedding
Send any text to the embedding model. Get back a list of meaning-coordinates.
from openai import OpenAI client = OpenAI() resp = client.embeddings.create( model="text-embedding-3-small", input="comfortable couch", ) embedding = resp.data[0].embedding # โ [0.012, -0.187, 0.443, ...] (1536 nums)
- 3
Store in a vector database
Save the embedding alongside its original text so you can retrieve it later.
import chromadb db = chromadb.Client() collection = db.create_collection("library") collection.add( documents=["comfortable couch"], embeddings=[embedding], ids=["doc_1"], ) - 4
Search by meaning
Embed your query, then ask the database for the closest stored meanings.
query_resp = client.embeddings.create( model="text-embedding-3-small", input="places to sit", ) query_vec = query_resp.data[0].embedding results = collection.query( query_embeddings=[query_vec], n_results=3, ) # finds: "comfortable couch", "sofa"...
Pro tip
You never store the exact words in a vector database โ you store the coordinates of their meaning. That's why searching works across synonyms and paraphrases.
Explore the library chat โจ
Questions about embeddings, vector search, RAG, or how AI remembers? Popy is ready.
You're a Semantic Librarian now
You now understand how AI systems store meanings as coordinates, organise related ideas in semantic space, and retrieve the right knowledge by meaning โ no exact match needed.
Semantic Shelf
Deliverable: Embed five short docs and return top-2 matches for a user query.
Stretch: Display similarity score for each retrieved result.
Complete the deliverable first, then unlock the stretch goal.