Our Pinecone integration provides advanced control for users who want to manage their vector database directly. Unlike traditional RAG Tuning, which abstracts much of the complexity, the Pinecone integration allows for full control over the RAG process, including indexing and querying vectors with your own configurations.
Pinecone Integration gives businesses the ability to:
With our system, collections act as a combination of Pinecone's index and namespace, and users can specify the vector size during collection creation, making it highly customizable and scalable for any AI application.
Creating a vector collection in our system combines the concepts of index and namespace from Pinecone. Here's how to create a collection:
curl -L -X POST 'https://apipie.ai/v1/vectors' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collectionName": "my-collection",
"dimension": 512
}'
This request creates a new vector collection with a specific dimension. You can define the size of your vectors by setting the dimension parameter.
To retrieve a list of all vector collections under your account:
curl -L -X POST 'https://apipie.ai/v1/vectors/listcollections' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{}'
This returns an array of vector collections that have been created. Remember, our collection refers to both the index and namespace.
You can delete an entire collection or specific vectors within it. Here’s how to do it:
curl -L -X POST 'https://apipie.ai/v1/vectors/delete' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collection": "my-ragtune-collection",
"collectionName": "my-collection",
"deleteAll": false,
"ids": [
"id1",
"id2"
],
"filter": {
"key": "value"
}
}'
Use this request to delete specific vectors by ID or delete the entire collection if needed.
You can insert or update (upsert) vectors in your collection with metadata and embeddings:
curl -L -X PUT 'https://apipie.ai/v1/vectors/upsert' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collectionName": "my-collection",
"vectorId": "vector-id-123",
"metatag": "sampleTag",
"data": "This is some clear text data associated with the vector",
"embedding": [
0.1,
0.2,
0.3
]
}'
This upserts a vector into the collection, allowing you to include both metadata and embeddings for future querying.
To list vector IDs from a collection:
curl -L -X POST 'https://apipie.ai/v1/vectors/list' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collectionName": "my-collection",
"limit": 100,
"prefix": "prefix",
"paginationToken": "token123"
}'
You can paginate through results using the paginationToken and set a limit on how many vector IDs to return.
To fetch the contents of a specific vector by its ID:
curl -L -X GET 'https://apipie.ai/v1/vectors/fetch' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collectionName": "my-collection",
"ids": "vector-id-123"
}'
This request retrieves the specified vector's content and metadata from your collection.
You can query the vectors in your collection to find the most relevant ones:
curl -L -X POST 'https://apipie.ai/v1/vectors/query' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"collectionName": "my-collection",
"vector": [
0.1,
0.2,
0.3
],
"topK": 10,
"includeValues": true,
"includeMetadata": false,
"filter": {
"key": "value"
},
"metatag": "tag123"
}'
This request allows you to query vectors based on their embeddings, metadata, or additional filters.
Once you’ve created a collection and upserted vectors, you can integrate this vector collection into any query using the rag_tune parameter. This approach allows you to augment your AI model with your custom vector data for enhanced responses:
curl -L -X POST 'https://apipie.ai/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"messages": [
{
"role": "user",
"content": "Why is the sky blue?"
}
],
"model": "gpt-3.5-turbo",
"provider": "openai",
"rag_tune": "my-collection"
}'
This adds the vector-based augmentation from your specified collection into the AI model’s query.
rag_tune parameter, empowering users to manage custom embeddings effectively.Keep in mind that Pinecone Integration incurs the following costs:
collectionName and dimension parameters, you effectively create both the index and namespace in one step.rag_tune parameter to augment any model we support, providing more contextually accurate responses based on your custom data.Our Pinecone Integration empowers businesses to fully control their vector databases and fine-tune AI responses with custom data. This feature ensures scalability, flexibility, and affordability, allowing users to manage and query vectors directly for advanced RAG capabilities.
Integrated Model Memory (IMM): Conversation Mgmt
Enhance your AI applications with Integrated Model Memory: Seamless solution for managing conversational context, multi-session memory, & message expiration. Perfect for context-aware AI apps.
Historic Usage Guide: Analyze Costs & Performance
Discover Apipie's Historic Usage API, offering unmatched transparency in tracking past queries for effective cost management and performance