npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-pinecone

v1.0.7

Published

Pinecone makes it easy to provide long-term memory for high-performance AI applications

Downloads

58

Readme

node-red-contrib-pinecone

Pinecone makes it easy to provide long-term memory for high-performance AI applications

flow npm

Quick Start

Install with the built in Node-RED Palette manager or using npm:

npm install node-red-contrib-pinecone

Properties Index Operations

msg.PINECONE_API_KEY = "Your API key";
msg.PINECONE_ENVIRONMENT = "Your environment";
msg.PINECONE_BASE_URL = "https://controller.[Your environment].pinecone.io";
  1. When msg.actionType is set to list_collections: This operation returns a list of your Pinecone collections

  2. When msg.actionType is set to create_collection:

    • [Required] name: [Type: string] The name of the collection to be created

    • [Required] source: [Type: string] The name of the source index to be used as the source for the collection

  3. When msg.actionType is set to describe_collection:

    • [Required] name: [Type: string] The name of the collection
  4. When msg.actionType is set to delete_collection:

    • [Required] name: [Type: string] The name of the collection
  5. When msg.actionType is set to list_collections: This operation returns a list of your Pinecone indexes

  6. When msg.actionType is set to create_index:

    • [Required] name: [Type: string] The name of the collection to be created

    • [Required] dimension: [Type: integer] The dimensions of the vectors to be inserted in the index

    • metric: [Type: string] The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'

    • pods: [Type: integer] The number of pods for the index to use,including replicas

    • replicas: [Type: integer] The number of replicas. Replicas duplicate your index. They provide higher availability and throughput

    • pod_type: [Type: string] The type of pod to use. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.

    • metadata_config: [Type: object | null] Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:

    {"indexed": ["example_metadata_field"]}
    • source_collection: [Type: string] The name of the collection to create an index from

Example:

    msg.payload = {
        name: "pinecone-index",
        metric: "cosine",
        pods: 1,
        replicas: 1,
        pod_type: "p1.x1"
    }
  1. When msg.actionType is set to describe_index:

    • [Required] name: [Type: string] The name of the collection
  2. When msg.actionType is set to delete_index:

    • [Required] name: [Type: string] The name of the collection
  3. When msg.actionType is set to configure_index:

    • [Required] name: [Type: string] The name of the collection

    • replicas: [Type: string] The desired number of replicas for the index

    • pod_type: [Type: string] The new pod type for the index. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.

Properties Vector operations

msg.PINECONE_API_KEY = "Your API key";
msg.PINECONE_ENVIRONMENT = "Your environment";
msg.PINECONE_BASE_URL = "https://index_name-project_id.svc.environment.pinecone.io";
  1. When msg.actionType is set to fetch:

    • [Required] msg.name: The name of the index

    • [Required] msg.vectors: The vector IDs to fetch. Does not accept values containing spaces. For example:

     msg.payload = {
         name: "pinecone-index",
         vectors: ["vec1", "vec2"]
     };
  2. When msg.actionType is set to query:

    • [Required] name: [Type: string] The name of the index

    • [Required] topK: [Type: int64] The number of results to return for each query

    • filter: [Type: object] The filter to apply. You can use vector metadata to limit your search. See docs

    • includeValues: [Type: boolean] Indicates whether vector values are included in the response

    • includeMetadata: [Type: boolean] Indicates whether metadata is included in the response as well as the ids

    • vector: [Type: array of floats] The query vector. This should be the same length as the dimension of the index being queried. Each query() request can contain only one of the parameters id or vector.

    • sparseVector: [Type: object] Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be the same length

    • id: [Type: string] The unique ID of the vector to be used as a query vector. Each query() request can contain only one of the parameters queries, vector, or id

    Example:

     msg.payload = {
         name: "pinecone-index",
         topK: 10,
         vector: [0.1,0.2,0.3],
         namespace: 'example-namespace'
     };
  3. When msg.actionType is set to update:

    • [Required] name: [Type: string] The name of the index

    • [Required] id: [Type: string] Vector's unique id

    • values: [Type: array of floats] Vector data

    • sparseValues: [Type: object] Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be the same length

    • setMetadata: [Type: object] Metadata to set for the vector

    • namespace: [Type: string] The namespace containing the vector to update

    Example:

     msg.payload = {
         name: "pinecone-index",
         id:'vec1',
         values: [0.1,0.2,0.3,0.4],
         setMetadata: {'genre': 'drama'},
         namespace: 'example-namespace'
     };
  4. When msg.actionType is set to upsert:

    • [Required] name: [Type: string] The name of the index

    • [Required] vectors: [Type: array of objects] An array containing the vectors to upsert. Recommended batch limit is 100 vectors

    • namespace: [Type: string] This is the namespace name where you upsert vectors

    Example:

     msg.payload = {
         name: "pinecone-index",
         vectors: [
             {
                 id: 'vec2',
                 values: [0.2,0.3,0.4,0.5],
                 metadata: {'genre': 'action'}
             }
         ]
     };
  5. When msg.delete is set to upsert:

    • [Required] name: [Type: string] The name of the index

    • [Required] ids: [Type: array of strings] Vectors to delete

    • deleteAll: [Type: boolean] This indicates that all vectors in the index namespace should be deleted

    • namespace: [Type: string] The namespace to delete vectors from, if applicable

    • filter: [Type: boolean] If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying IDs to delete in the ids param or using delete_all=True. See doc

    Example:

     msg.payload = {
         name: "pinecone-index",
         ids: ["vec1", "vec2"]
     };
  6. When msg.delete is set to describeIndexStats:

    • [Required] name: [Type: string] The name of the index

    • filter: [Type: boolean] If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See doc

Bugs reports and feature requests

Please report any issues or feature requests at GitHub.

License

MIT License