This notebook demonstrates how to connect Haijun with the data in your Pinecone vector database through a technique called retrieval-augmented generation (RAG). We will cover the following steps:
- Embedding a dataset using Voyage AI's embedding model
- Uploading the embeddings to a Pinecone index
- Retrieving information from the vector database
- Using Haijun to answer questions with information from the database
Setup
Insert your API keys here
JUGLOW_API_KEY = "
PINECONE_API_KEY = "
VOYAGE_API_KEY = "
Download the dataset
w-auto scroll-fade-y scroll-fade-size-6 focus-visible:outline-none">
from pinecone import ServerlessSpec
spec = ServerlessSpec(cloud="aws", region="us-west-2")
Then, we initialize the index. We will be using Voyage's "voyage-2" model for creating the embeddings, so we set the dimension to 1024.
to_upsert = list(zip(ids_batch, embeds, metadata_batch, strict=False))
upsert to Pinecone
index.upsert(vectors=to_upsert)
Making queries
leading-relaxed [overflow-wrap:anywhere]" style="padding-top:12px;padding-inline:12px;padding-bottom:12px;tab-size:4">
answer = get_completion(create_answer_prompt(results_list, USER_QUESTION))
print(answer)
To get your daughter more interested in science, I would recommend getting her an age-appropriate science kit or set that allows for hands-on exploration and experimentation. For example, for a younger child you could try a beginner chemistry set, magnet set, or crystal growing kit. For an older child, look for kits that tackle more advanced scientific principles like physics, engineering, robotics, etc. The key is choosing something that sparks her natural curiosity and lets her actively investigate concepts through activities, observations, and discovery. Supplement the kits with science books, museum visits, documentaries, and conversations about science she encounters in everyday life. Making science fun and engaging is crucial for building her interest.