Generative AI: Lessons from 5 Projects, Part 2 Embedding

Discover embeddings and their power for semantic searches, classification, and multimodal recommendations. Guide to vector storage, metadata, and practical examples.

domingo, 17 de agosto de 2025 • 5 min read • Q2BSTUDIO Team

Artificial-Intelligence-

What to expect: In the second part of the series on Building with Generative AI Lessons from 5 Projects, we dive deep into embeddings and how they enable building semantic search, recommendation, classification, and more systems. This article explains what embeddings are, examples of practical use, and how to integrate them into real solutions.

What is an embedding: An embedding is a numerical representation of objects such as text, images, or audio in a continuous vector space. Embedding models transform variable inputs into fixed-size vectors whose values capture semantic characteristics of the content. Objects with similar meaning are close together in that space according to metrics like cosine similarity.

Embeddings and semantic meaning: Although typical dimensions are in the hundreds and cannot be easily visualized, the concept is the same as coordinates in a multidimensional space. For example, an embedding of the word queen will be close to woman, ruler, and state, allowing results to be retrieved by description rather than by literal word matching.

Example project Simple transcript search engine: Imagine a six-hour podcast. The practical flow is to divide the transcript into manageable chunks, generate embeddings for each chunk, and then search for the chunks most similar to a user query. This makes it possible to find precise moments where topics like Ruby on Rails, TypeScript, or management criticisms are discussed, and build timestamped links to play on YouTube.

How it works at a high level: 1 Read and segment the transcript into blocks by minutes or 30-second intervals. 2 Generate embeddings using a model like all MiniLM L6 v2 or multimodal models like CLIP or ImageBind if there are images or audio. 3 Store embeddings and metadata for each chunk for later querying. 4 Upon receiving a query, convert it into an embedding and retrieve the k most similar chunks using cosine similarity, applying metadata filters if necessary.

Example results: With a query like why managers are useless or why I hate JavaScript, you can get direct links to the relevant minutes of the episode, sorted by similarity score, greatly speeding up the location of ideas and quotes in long audios or videos.

Where to store embeddings: For real applications, it is recommended to persist the vectors in a specialized database. Open source options include Chroma, Weaviate, and Milvus, and in traditional databases you can use Postgres with pgvector or ElasticSearch. There are also managed services like Pinecone and cloud solutions from AWS and Google that facilitate scaling and availability.

Metadata filtering: Alongside each embedding, it is advisable to store metadata such as video_id, start_time, end_time, year, or role. Metadata allows two strategies: first retrieve by vector and then filter by metadata, or filter by metadata to reduce the set and then search by vector. This approach is key in enterprise applications where context and permissions matter.

Project 2.2 Embedding, storage, and metadata with Chroma: Chroma is an embeddable store that makes it easy to save documents, embeddings, and metadata. Using a persistent collection avoids reprocessing already indexed transcripts. Storing video metadata and timestamps allows generating exact links to play clips and improves the search experience.

Performance: The initial indexing may take seconds or minutes depending on size and machine. Subsequent queries are usually very fast because only the query embedding is calculated and the k most similar vectors are retrieved from the database.

What you can build with embeddings: Similarity search for text, images, and audio; k-nearest neighbor classification systems using metadata to decide labels; clustering to group similar content and clean up spaces with hundreds or thousands of items; content-based recommendations to suggest semantically close articles, videos, or products.

Multimodal cases: Models like CLIP allow searching images by text and vice versa. ImageBind and other multimodal models support text, images, and audio, expanding possibilities for search and recommendation systems that mix different sources.

Real project built Podcast Segment Search: For a personal podcast with over 200 episodes, transcripts were downloaded, segmented into 30-second blocks, embeddings were generated, and stored in a vector database. When searching for a phrase or idea, the episode and exact timestamp are obtained, facilitating quick location of desired content.

Credits and next steps in the series: Thanks to experts like Simon Willison for the material on embeddings. In upcoming installments, we will explore intelligent agents that combine LLMs with access to external tools to create contextual assistants capable of querying forecast APIs, browsing and reading academic articles, or executing custom workflows.

About Q2BSTUDIO: Q2BSTUDIO is a software development and custom applications company specialized in artificial intelligence, cybersecurity, and AWS and Azure cloud services. We offer custom software and custom applications designed to transform business processes through AI solutions for companies, custom AI agents, and business intelligence services. Our services include integration of embedding models, implementation of vector databases, improvement of semantic search engines, recommendations, and data pipelines for Power BI. We also provide cybersecurity services and AWS and Azure cloud solutions to ensure secure and scalable deployments.

Why choose Q2BSTUDIO: We have experience in artificial intelligence projects applied to real problems, creation of AI agents to automate tasks, consulting in business intelligence services, and development of dashboards with Power BI for data-driven decision making. We design custom software that integrates AI for companies and ensures compliance and security through advanced cybersecurity practices.

Relevant keywords for positioning: custom applications, custom software, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, AI for companies, AI agents, Power BI. If you are looking to modernize your processes, improve semantic search and recommendation, or deploy custom intelligent agents, Q2BSTUDIO can help you design and execute the solution.

Final summary: Embeddings are a fundamental piece for building modern semantic systems. Combined with vector databases and metadata, they enable powerful solutions for search, classification, recommendation, and multimodal analysis. Integrating these capabilities with security practices, cloud architecture, and BI boosts the digital transformation of organizations and opens the door to smarter and more contextual AI agents.

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.