{"id":9182,"library":"pinecone-text","title":"Pinecone Text Client","description":"The Pinecone Text Client is a Python package that provides text utilities for generating sparse, dense, and hybrid vector embeddings. It is designed for seamless integration with Pinecone's vector database to facilitate sparse-dense (hybrid) semantic search. Currently, it is a public preview ('Beta') version, with the latest release being 0.11.0. Release cadence is infrequent, focusing on feature additions and improvements within its beta phase.","status":"active","version":"0.11.0","language":"python","source_language":"en","source_url":"https://github.com/pinecone-io/pinecone-text-python","tags":["text processing","embeddings","vector search","sparse vectors","dense vectors","hybrid search","pinecone","nlp"],"install":[{"cmd":"pip install pinecone-text","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for interacting with the Pinecone vector database, as pinecone-text provides embedding utilities that are typically used to prepare data for Pinecone indexes.","package":"pinecone","optional":false},{"reason":"Required if using the `OpenAIEncoder` for dense vector generation.","package":"openai","optional":true},{"reason":"Underlying dependency for SPLADE and Sentence Transformer models; incompatibility issues exist with Python 3.12.","package":"torch","optional":true}],"imports":[{"wrong":"from pinecone_text import OpenAIEncoder","symbol":"OpenAIEncoder","correct":"from pinecone_text import OpenAIEncoder"}],"quickstart":{"code":"import os\nfrom pinecone_text.dense import OpenAIEncoder\n\n# Ensure OPENAI_API_KEY is set in your environment\n# For quick testing, you can uncomment and set it directly, but prefer environment variables\n# os.environ[\"OPENAI_API_KEY\"] = \"YOUR_OPENAI_API_KEY\"\n\nif not os.environ.get(\"OPENAI_API_KEY\"):\n    print(\"Error: OPENAI_API_KEY environment variable not set.\")\n    print(\"Please set it or uncomment the line above for testing.\")\nelse:\n    try:\n        encoder = OpenAIEncoder() # Defaults to 'text-embedding-3-small'\n        documents = [\n            \"The quick brown fox jumps over the lazy dog\",\n            \"Artificial intelligence is transforming industries\"\n        ]\n        queries = [\n            \"Who jumped over the lazy dog?\",\n            \"What is AI doing?\"\n        ]\n\n        document_vectors = encoder.encode_documents(documents)\n        query_vectors = encoder.encode_queries(queries)\n\n        print(f\"Encoded document 1 vector (first 5 elements): {document_vectors[0][:5]}...\")\n        print(f\"Encoded query 1 vector (first 5 elements): {query_vectors[0][:5]}...\")\n    except Exception as e:\n        print(f\"An error occurred during encoding: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `OpenAIEncoder` and use it to generate dense vector embeddings for both documents and queries. It highlights the necessity of setting the `OPENAI_API_KEY` environment variable."},"warnings":[{"fix":"Monitor official documentation and release notes for breaking changes and updates. Test thoroughly when upgrading.","message":"The `pinecone-text` library is currently in 'public preview' ('Beta'). This means its API or behavior may change in future updates.","severity":"gotcha","affected_versions":"0.1.0 - 0.11.0"},{"fix":"Remove `pinecone-client` from your `requirements.txt` or `pyproject.toml` and add `pinecone` instead. For example, `pip uninstall pinecone-client && pip install pinecone`.","message":"The main Pinecone Python SDK was renamed from `pinecone-client` to `pinecone` in version 5.1.0. If you are migrating or have existing projects, ensure you update your dependencies to `pinecone` to get the latest features and avoid conflicts.","severity":"breaking","affected_versions":"pinecone-client < 5.1.0"},{"fix":"Be aware of this limitation when building systems where document frequencies are expected to change frequently. Consider re-fitting the BM25 model if the corpus changes significantly, or use alternative sparse encoding methods.","message":"The `BM25Encoder` currently supports only static document frequency. This means precomputed document frequency values are fixed and do not dynamically update when new documents are added to a collection.","severity":"gotcha","affected_versions":"0.1.0 - 0.11.0"},{"fix":"Use Python versions 3.9, 3.10, or 3.11 if you need to use SPLADE or Sentence Transformer models. Check `pinecone-text` release notes for future Python 3.12 compatibility updates.","message":"Using SPLADE and Sentence Transformer models with `pinecone-text` is not currently supported on Python 3.12 due to compatibility issues with PyTorch.","severity":"breaking","affected_versions":"0.1.0 - 0.11.0 with Python 3.12"},{"fix":"Set the `OPENAI_API_KEY` (or `AZURE_OPENAI_API_KEY` and other Azure-specific variables for `AzureOpenAIEncoder`) environment variable before importing and instantiating the encoder class.","message":"When using `OpenAIEncoder` or `AzureOpenAIEncoder`, the corresponding API key (e.g., `OPENAI_API_KEY`) must be set as an environment variable before the encoder is initialized.","severity":"gotcha","affected_versions":"0.1.0 - 0.11.0"}],"env_vars":null,"search_vec":"'0.11.0':56 'addit':64 'beta':49,69 'cadenc':58 'client':3,7 'current':43 'databas':34 'dens':19,39,78 'design':26 'embed':23,73 'facilit':36 'featur':63 'focus':61 'generat':17 'hybrid':21,40,80 'improv':66 'infrequ':60 'integr':29 'latest':53 'nlp':83 'packag':11 'phase':70 'pinecon':1,5,31,82 'preview':48 'process':72 'provid':13 'public':47 'python':10 'releas':54,57 'seamless':28 'search':42,75,81 'semant':41 'spars':18,38,76 'sparse-dens':37 'text':2,6,14,71 'util':15 'vector':22,33,74,77,79 'version':50 'within':67","created_at":"2026-04-16T18:48:53.707484+00:00","updated_at":"2026-04-16T18:48:53.707484+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'OpenAIEncoder' from 'pinecone_text' (/tmp/tmpuej0wqlg/venv/lib/python3.12/site-packages/pinecone_text/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.11.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://www.pinecone.io","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pinecone-text/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["vector-search","ai-ml","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}