OptionalResearchVersion 1.0.0

Pinecone Research Skill for Hermes Agent: RAG & Long-Term Memory

Agent RAG and long-term memory with Pinecone.

Written by Neura Market from the official Hermes Agent documentation for Pinecone Research. Commands, paths, and version numbers are reproduced from the source unchanged.

Read the official documentation

This skill turns Pinecone into a persistent memory backend for Hermes Agent conversations. You store embeddings from past sessions, retrieve relevant context on demand, and build long-term memory that survives agent restarts. Reach for this when you need a vector store that keeps agent history searchable across sessions, especially for research or prototyping semantic search workflows.

What it does

The skill wires Pinecone as a retrieval-augmented generation (RAG) backend. You can persist conversation embeddings, query them later with natural language, and isolate memory by session or user using namespaces. It uses LangChain's Pinecone integration and OpenAI embeddings out of the box, so the agent can recall what it discussed yesterday without reloading raw logs.

Before you start

  • A Pinecone account and API key. The free tier gives you one index and 100K vectors at 1536 dimensions, enough for prototyping.
  • Python environment with pip.
  • The skill is optional and installed on demand. It runs on Linux, macOS, and Windows.

Setup

pip install pinecone-client langchain-pinecone langchain-openai

Set your API key:

export PINECONE_API_KEY="your-api-key"

Basic RAG pipeline

This creates a Pinecone index named agent-memory (if it doesn't exist), stores documents as embeddings, and retrieves the five most relevant chunks for a query.

from pinecone import Pinecone, ServerlessSpec
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings

# Initialize Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])

# Create or connect to index
index_name = "agent-memory"
if index_name not in [i.name for i in pc.list_indexes()]:
    pc.create_index(
        name=index_name,
        dimension=1536,
        metric="cosine",
        spec=ServerlessSpec(cloud="aws", region="us-east-1"),
    )

# Build vector store
vectorstore = PineconeVectorStore.from_documents(
    documents=docs,
    embedding=OpenAIEmbeddings(),
    index_name=index_name,
)

# Retrieve relevant context
retriever = vectorstore.as_retriever(search_kwargs={"k": 5})
results = retriever.invoke("What did the agent discuss yesterday?")

Namespace-based session memory

Use namespaces to keep each session's memory separate. Querying without a namespace filter searches across all sessions.

# Store per-session memory
vectorstore = PineconeVectorStore(
    index=pc.Index(index_name),
    embedding=OpenAIEmbeddings(),
    namespace=f"session-{session_id}",
)

# Query across all sessions (no namespace filter)
all_memory = PineconeVectorStore(
    index=pc.Index(index_name),
    embedding=OpenAIEmbeddings(),
)
results = all_memory.similarity_search("relevant query", k=10)

Best practices

  1. Namespace by session or user, isolate data for multi-tenant agents
  2. Batch upserts, 100, 200 vectors per batch for efficiency
  3. Metadata filtering, tag vectors with session ID, timestamp, topic
  4. Prune old memory, delete stale namespaces to control costs
  5. Use serverless, auto-scaling, pay-per-use pricing

When not to use it

If you need a general Pinecone reference for index management, CRUD operations, or hybrid search without agent integration, use the mlops/pinecone skill instead. That skill is better suited for production infrastructure work.

Limits and gotchas

  • The free tier limits you to one index and 100K vectors at 1536 dimensions. Exceeding that requires a paid plan.
  • The skill uses OpenAI embeddings by default, which incurs API costs beyond Pinecone's own pricing.
  • Namespace isolation is logical, not physical. Deleting a namespace is the only way to remove old session data.

What pairs with this

More Research skills