Introduction to Pinecone Vector Database (original) (raw)

Last Updated : 15 Apr, 2026

Pinecone is a fully managed vector database for AI applications that enables fast storage, indexing and search of high-dimensional embeddings, supporting semantic search and recommendations without managing infrastructure.

Vector Databases

A vector database is designed to store, index and search high-dimensional embeddings, enabling similarity-based search instead of exact matches. It uses methods like cosine similarity or Euclidean distance to find semantically similar data.

Vector-Embedding

Vector Databases

Features of Pinecone Vector Database

Getting Started with Pinecone

Step 1: Sign Up and Log In

Create an account on Pinecone and log in to access the dashboard and API credentials.

Pinecone

Pinecone

Step 2: Get Your API Key

Pinecone

API Key

Step 3: Install Pinecone Python Client

Run pip install pinecone in your terminal to install the Pinecone Python client library. This lets you connect to and use Pinecone’s vector database from your Python code.

Python `

pip install pinecone

`

Step 4: Initialize Pinecone

from pinecone import Pinecone

pc = Pinecone(api_key="your api key")

`

Step 5: Create an Index

index = pc.Index("gfg")

`

Step 6: **Upsert Vectors

vectors = [ { "id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"text": "example text 1"} }, { "id": "vec2", "values": [0.4, 0.5, 0.6], "metadata": {"text": "example text 2"} } ]

`

Step 7: Query the Index

query_vector = [0.1, 0.2, 0.3] Result = index.query( vector=[0.1, 0.2, 0.3], top_k=2, include_metadata=True ) for match in response.matches: print(f"ID: {match.id}") print(f"Score: {match.score}") print(f"Metadata: {match.metadata}")

`

**Output:

ID: vec1
Score: 0.9998
Metadata: {'text': 'example text 1'}
ID: vec2
Score: 0.85
Metadata: {'text': 'example text 2'}

Applications