Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinecone Native Integration #485

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

monami44
Copy link

@monami44 monami44 commented Nov 3, 2024

Pinecone Integration with Comprehensive Testing Suite

Overview

This PR introduces a comprehensive Pinecone integration along with extensive testing coverage across vector operations, RAG implementations, inference capabilities, and assistant functionalities.

Key Features

PineconeProvider Class

  • Implements a robust provider class that wraps Pinecone's functionality with instrumentation.
  • Handles both data plane and control plane operations.
  • Includes comprehensive error handling and event tracking.
  • Supports both traditional Pinecone operations and newer features like the Assistant API.
  • Note: Currently, there is no support for evaluating answers using the Assistant API.

Testing Suites

RAG Pipeline Test (pinecone_rag_test.py)

  • Tests the complete RAG (Retrieval-Augmented Generation) workflow.
  • Covers index creation, document embedding, and semantic search.
  • Implements vector operations (upsert, update, delete).
  • Tests collection management.
  • Includes real-world query testing with context retrieval.

Inference API Test (pinecone_inference_test.py)

  • Tests Pinecone's embedding generation capabilities.
  • Implements document reranking functionality.
  • Validates usage tracking and response formatting.
  • Tests various embedding models and configurations.

Assistant API Test (pinecone_assistant_test.py)

  • Tests Pinecone's Assistant API functionality.
  • Covers assistant creation, updating, and deletion.
  • Implements file upload and management.
  • Tests chat completions using an OpenAI-compatible interface.
  • Note: There is currently no support for evaluating answers within the Assistant API (premium tier feature)

Implementation Details

  • Comprehensive error handling and logging are included.
  • Event tracking for all operations is implemented.
  • Support for both synchronous and streaming responses is provided.
  • Proper cleanup of resources after each test is ensured.
  • Integrated with AgentOps for monitoring and tracking.

Testing Instructions

  1. Ensure that the required environment variables are set:

    • PINECONE_API_KEY
    • OPENAI_API_KEY (for RAG testing)
  2. Run individual test suites with the following commands:

    python tests/core_manual_tests/providers/pinecone_rag_test.py
    python tests/core_manual_tests/providers/pinecone_inference_test.py
    python tests/core_manual_tests/providers/pinecone_assistant_test.py

Notes

  • All tests are designed to be idempotent, ensuring no repeated impact on test results.
  • Comprehensive resource cleanup is included in all test flows.
  • Tests include rate limiting and appropriate delays to ensure API stability.
  • Extensive error handling and detailed reporting are part of the suite.

Future Improvements

  • Add support for batch operations to enhance efficiency.
  • Implement retry logic for handling transient failures.
  • Integrate custom embedding model support.
  • Enhance streaming response handling for smoother real-time interactions.

For more information, refer to the Pinecone Documentation.

Copy link

gitguardian bot commented Nov 3, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret 4570e65 agentops/llms/pinecone_test.py View secret
- - Generic High Entropy Secret 5b0a5b1 agentops/llms/pinecone_test.py View secret
- - Generic High Entropy Secret 5b0a5b1 agentops/llms/pinecone_test.py View secret
- - Generic High Entropy Secret 4570e65 agentops/llms/pinecone_test.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@areibman
Copy link
Contributor

areibman commented Nov 4, 2024

Amazing-- this is actually the first vectorDB integration PR we've seen so far. Will take a look soon @monami44.

In the meantime-- can you resolve the merge conflict?

@monami44
Copy link
Author

monami44 commented Nov 4, 2024

Hey @areibman , I just resolved the merge conflict. Also here is a video-walkthrough I sent to Adam as I submitted the PR. Hit me up if you want anything else to be changed

@areibman
Copy link
Contributor

areibman commented Nov 5, 2024

Super cool! @the-praxs and I can take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants