A Beginner’s Guide to Vector Search

Vector search is having a moment. Every AI application seems to need it. But what is it really, and do you actually need it?

What Is Vector Search?

At its core, vector search is about finding similar things.

Instead of searching for exact keyword matches, you convert data (text, images, audio) into vectors—lists of numbers that represent meaning. Then you find vectors that are close to each other in space.

Example: The vectors for “cat”, “kitten”, and “feline” are close together in vector space because they mean similar things.

Embeddings: How Data Becomes Numbers

An embedding is a representation of data as a vector. Modern embeddings come from machine learning models trained on massive datasets.

Popular embedding models:

  • OpenAI’s text-embedding-3: State-of-the-art for text, easy to use
  • Google’s PaLM embeddings: Great for multilingual content
  • Hugging Face embeddings: Open-source, self-hosted options
  • Cohere: Purpose-built for semantic search

Similarity Metrics: How Close Is Close?

Once you have vectors, how do you measure similarity?

  • Cosine similarity: Measures angle between vectors (most common, 0-1 scale)
  • Euclidean distance: Straight-line distance in vector space
  • Dot product: Algebraic similarity

For most use cases, cosine similarity is your friend.

Vector Databases: Do You Need One?

Here’s the hard truth: you probably don’t need a dedicated vector database yet.

Use PostgreSQL with pgvector if:

  • You already use Postgres
  • You have fewer than 1M vectors
  • Performance is acceptable

Use Pinecone/Weaviate/Milvus if:

  • You have millions of vectors
  • Sub-millisecond latency is required
  • You need sophisticated filtering alongside similarity search

Real-World Use Cases

  • Semantic search: Find documents similar to a query, not just keyword matches
  • Recommendation systems: Find products/content similar to what users liked
  • Anomaly detection: Find vectors far from the normal distribution
  • Image search: Find visually similar images
  • Question answering: Find relevant documents to answer user questions

Vector search is powerful, but it’s not magic. It’s a tool for finding similarities. Use it when that’s actually what you need.

5 AI Agent Frameworks Compared: Which One Should You Learn First?

AI agents are no longer theoretical. Companies are building them, deploying them, and making money from them. But the framework landscape is crowded, and the wrong choice can set you back months.

I’ve built production agents with each of these frameworks. Here’s what actually matters when choosing.

LangChain: The Swiss Army Knife

Best for: Getting something working quickly

LangChain is the most popular agent framework for a reason. It abstracts away the complexity of connecting LLMs to tools, databases, and APIs.

Pros:

  • Massive community and documentation
  • Integrations with everything (50+ LLM providers, 100+ tools)
  • Great for rapid prototyping
  • Easy to get started

Cons:

  • Can feel bloated for simple use cases
  • Performance overhead from abstraction layers
  • Less control over agent behavior

Best if: You’re new to agents and want to learn by building quickly

CrewAI: Multi-Agent Orchestration

Best for: Complex workflows with multiple specialized agents

CrewAI is built for teams of agents working together. Each agent has a role, goal, and set of tools.

Pros:

  • Elegant API for multi-agent systems
  • Easy to define agent roles and responsibilities
  • Good for complex workflows
  • Growing ecosystem of integrations

Cons:

  • Newer, smaller community than LangChain
  • Less flexibility for edge cases
  • Documentation is still catching up

Best if: You’re building a system where multiple agents need to collaborate

AutoGen: Research-Grade Quality

Best for: Production systems with strict reliability requirements

AutoGen comes from Microsoft research and shows it. It’s purpose-built for conversation-based AI systems with careful state management.

Pros:

  • Battle-tested (used in production at major companies)
  • Excellent error handling
  • Great for chat-based agents
  • Well-researched approach to agent design

Cons:

  • Steeper learning curve
  • More verbose than other frameworks
  • Less flashy (but more reliable)

Best if: You need rock-solid reliability and don’t mind extra complexity

LlamaIndex Agents: For RAG-Heavy Workloads

Best for: Agents that work primarily with knowledge bases and documents

LlamaIndex specializes in retrieval-augmented generation. If your agent needs to search through documents and retrieve context, this is purpose-built for that.

Pros:

  • Excellent document indexing and retrieval
  • Native support for vector DBs
  • Great for knowledge-based agents
  • Good performance at scale

Cons:

  • Narrower use case
  • Less suitable for general-purpose agents
  • Smaller community

Best if: Your agent primarily works with documents or knowledge bases

OpenAI Assistants API: The Managed Option

Best for: Teams that want managed infrastructure and don’t want to maintain code

OpenAI manages the infrastructure, state, and execution. You define the assistant, set tools, and make API calls.

Pros:

  • Zero infrastructure to manage
  • OpenAI handles reliability and scaling
  • Simple API
  • Automatic state management

Cons:

  • Locked into OpenAI models (for now)
  • Less control over agent behavior
  • Higher per-call costs
  • Cold starts on function calls

Best if: You want a managed solution and vendor lock-in doesn’t concern you

The Recommendation

Learning? Start with LangChain. Biggest community, most examples, lowest friction to first agent.

Building teams of agents? CrewAI. The abstraction matches how humans think about collaboration.

Need production-grade reliability? AutoGen. It’s the unglamorous choice that actually ships.

Heavy on document search? LlamaIndex. Purpose-built for RAG, and it shows.

Want managed? Assistants API. Pay the premium for peace of mind.

The best framework is the one your team knows well enough to debug when things break. Master one before chasing the next shiny thing.