Prompt

vector database with python sdk

Technology / Databases1 observationLast seen Oct 7, 2026

Latest observation

Oct 7, 2026OpenAI APIWeb search: off

If you want to use a vector database with a Python SDK, here are the most common options and how to get started quickly.

Popular vector databases with Python SDKs

  • Pinecone — fully managed, easy to use
  • Weaviate — open-source and managed options
  • Qdrant — open-source and managed
  • Milvus — open-source, scalable
  • Chroma — simple local/vector store for prototyping
  • FAISS — library for vector search, not a database

Example: Qdrant with Python SDK

Install

pip install qdrant-client

Basic usage

from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct

client = QdrantClient(host="localhost", port=6333)

# Create collection
client.create_collection(
    collection_name="my_collection",
    vectors_config=VectorParams(size=4, distance=Distance.COSINE),
)

# Insert vectors
client.upsert(
    collection_name="my_collection",
    points=[
        PointStruct(id=1, vector=[0.1, 0.2, 0.3, 0.4], payload={"text": "hello"}),
        PointStruct(id=2, vector=[0.2, 0.1, 0.4, 0.3], payload={"text": "world"}),
    ],
)

# Search
results = client.search(
    collection_name="my_collection",
    query_vector=[0.1, 0.2, 0.3, 0.4],
    limit=2,
)

for r in results:
    print(r.id, r.score, r.payload)

Example: Pinecone with Python SDK

Install

pip install pinecone

Basic usage

from pinecone import Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("my-index")

index.upsert([
    ("id1", [0.1, 0.2, 0.3], {"text": "hello"}),
    ("id2", [0.3, 0.2, 0.1], {"text": "world"}),
])

res = index.query(vector=[0.1, 0.2, 0.3], top_k=2, include_metadata=True)
print(res)

Example: Chroma

Install

pip install chromadb

Basic usage

import chromadb

client = chromadb.Client()
collection = client.create_collection("my_collection")

collection.add(
    ids=["1", "2"],
    embeddings=[[0.1, 0.2, 0.3], [0.3, 0.2, 0.1]],
    metadatas=[{"text": "hello"}, {"text": "world"}],
)

results = collection.query(
    query_embeddings=[[0.1, 0.2, 0.3]],
    n_results=2
)
print(results)

Which should you choose?

  • Quick prototype / local app: Chroma
  • Production with managed service: Pinecone
  • Open-source production option: Qdrant or Weaviate
  • Large-scale self-hosted: Milvus
  • Pure similarity search library: FAISS

If you want, I can also give you:

  1. a full Python example with embeddings + vector DB
  2. a comparison table of Pinecone vs Qdrant vs Weaviate vs Chroma
  3. a Docker setup for local vector DB testing

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.