This vignette shows how to query an existing Pinecone index/namespace
from RAGFlowChainR.
2) Configure Pinecone target
# Optional if your endpoint requires API key auth
Sys.setenv(PINECONE_API_KEY = "your-pinecone-api-key")
# Format: "https://index-host|namespace"
# Namespace can be left empty: "https://index-host|"
pinecone_target <- "https://your-index-host|my_namespace"3) Create the RAG chain
my_llm <- function(prompt) {
"Mock answer from LLM."
}
rag_chain <- create_rag_chain(
llm = my_llm,
vector_database_directory = pinecone_target,
method = "Pinecone",
embedding_function = embed_openai(model = "text-embedding-3-small"),
embedding_dim = 1536,
use_web_search = FALSE
)