Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Class Assistants

    Assistants manages assistants and evaluates generated answers.

    Access it through pc.assistants; do not construct it directly. Use Pinecone.assistant to chat with one assistant and manage its files.

    import { Pinecone } from '@pinecone-database/pinecone';
    const pc = new Pinecone();
    const result = await pc.assistants.list();
    console.log(result.assistants);
    Index
    • Deletes an assistant by name.

      Parameters

      • assistantName: string

        The name of the assistant to delete, such as support-guide.

      Returns Promise<void>

      Resolves when the deletion request completes.

      Errors.PineconeArgumentError if assistantName is empty.

      import { Pinecone } from '@pinecone-database/pinecone';
      const pc = new Pinecone();
      await pc.assistants.delete('support-guide');
    • Gets assistant configuration and readiness status.

      Parameters

      • assistantName: string

        The name of the assistant, such as support-guide.

      Returns Promise<AssistantModel>

      Assistant details, including its status and host.

      Errors.PineconeArgumentError if assistantName is empty.

      import { Pinecone } from '@pinecone-database/pinecone';
      const pc = new Pinecone();
      const assistant = await pc.assistants.describe('support-guide');
      console.log(assistant.status);

      Assistants.list to discover assistants.

    • Evaluates a generated answer against a ground truth answer.

      Parameters

      • options: { answer: string; groundTruth: string; question: string }

        The question, generated answer, and reference answer in groundTruth.

      Returns Promise<AlignmentResponse>

      Correctness, completeness, and alignment metrics, with reasoning and usage.

      Errors.PineconeArgumentError if options are missing or an answer or question is empty.

      import { Pinecone } from '@pinecone-database/pinecone';
      const pc = new Pinecone();
      const result = await pc.assistants.evaluate({
      question: 'Where can I start a return?',
      answer: 'Start a return from your order history.',
      groundTruth: 'Customers can start returns from their order history.',
      });
      console.log(result.metrics);
    • Updates assistant instructions or metadata.

      Omitted fields are left unchanged; an empty instructions string is not applied.

      Parameters

      Returns Promise<UpdateAssistantResponse>

      The updated assistant name, instructions, and metadata.

      Errors.PineconeArgumentError if options or the assistant name are missing.

      import { Pinecone } from '@pinecone-database/pinecone';
      const pc = new Pinecone();
      const result = await pc.assistants.update({
      name: 'support-guide',
      instructions: 'Answer using the uploaded support policies and cite your sources.',
      });
      console.log(result.instructions);