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 🙏

© 2025 – Pkg Stats / Ryan Hefner

genkitx-voiceflow

v1.2.1

Published

Firebase Genkit AI framework plugin for Voiceflow APIs.

Downloads

214

Readme

Firebase Genkit + Voiceflow

genkitx-voiceflow is a community plugin for using Voiceflow Knowledge base in Firebase Genkit. Built by Xavier Portilla Edo.

Installation

Install the plugin in your project with your favorite package manager:

  • npm install genkitx-voiceflow
  • pnpm add genkitx-voiceflow

Configuration

To use the plugin, you need to configure it with your Voiceflow API key. You can do this by calling the genkit function:

import { genkit, z } from 'genkit';
import {github, openAIGpt4o} from "genkitx-voiceflow";

const ai = genkit({
  plugins: [
    openAI({ apiKey: process.env.OPENAI_API_KEY }),
    voiceflow([
      {
        name: 'kb',
        clientParams: {
          apiKey: process.env.VOICEFLOW_API_KEY!,
        }
      },
    ])
  ],
});

Usage

The plugin provides two main functionalities: index and retrieve. You can use them directly or within a Genkit flow.

Indexer

Indexer is used to index documents in the Voiceflow Knowledge Base. Voiceflow Knowledge Base only works with documents that contain a media field with a url property. The URL could be a link to a website or to a local file with file://.

Basic examples

The simplest way to call the indexer is by using the helper function index:

const voiceflowIndexer = voiceflowIndexerRef({
  name: 'kb'
});

const documents = [{ content: [{ media: { url: 'https://www.voiceflow.com' } }] }];
await ai.index({ indexer: voiceflowIndexer, documents });

Within a flow

// ...configure Genkit (as shown above)...

export const indexerFlow = ai.defineFlow(
  {
    name: 'indexerFlow',
    inputSchema: z.string(),
    outputSchema: z.string(),
  },
  async () => {

   const voiceflowIndexer = voiceflowIndexerRef({
     name: 'kb'
   });

   const documents = [{ content: [{ media: { url: 'https://www.voiceflow.com' } }] }];
   await ai.index({ indexer: voiceflowIndexer, documents });

   return 'done';
   
  }
);

Retriever

A retriever is used to retrieve documents from the Voiceflow Knowledge Base. You can pass a query and options to the retriever. The options object can contain the following properties:

  1. querySettings: An object with the following properties:
    • model: The model to use for the query. The default is gpt-4o.
    • temperature: The temperature to use for the query. The default is 0.7.
    • system: The system prompt to use for the query. The default is ''.
  2. k: The number of documents to retrieve. The default is 5.
  3. filters: filters to apply to the query. The default is [].

Basic examples

The simplest way to call the retriever is by using the helper function retrieve:

const voiceflowRetriever = voiceflowRetrieverRef({
  name: 'retriever'
});

const docs = await ai.retrieve({ retriever: voiceflowRetriever, query: subject, 
options:{
  querySettings: { model: 'gpt-4o', temperature: 0.7 },
  k: 5
}});

Within a flow

// ...configure Genkit (as shown above)...

export const retrieverFlow = ai.defineFlow(
  {
    name: 'retrieverFlow',
    inputSchema: z.string(),
    outputSchema: z.string(),
  },
  async (subject) => {

   const voiceflowRetriever = voiceflowRetrieverRef({
     name: 'retriever'
   });

   const docs = await ai.retrieve({ retriever: voiceflowRetriever, query: subject, 
    options:{
     querySettings: { model: 'gpt-4o', temperature: 0.7 },
     k: 5
   }});
   
   const llmResponse = await ai.generate({
      prompt: `What is Voiceflow?`,
      docs: docs,
    });
    return llmResponse.text;
  }
);

For more detailed examples and the explanation of other functionalities, refer to the official Genkit documentation.

Examples

You can find more examples in the examples folder.

Feature supported from Voiceflow Knowledge Base

This plugins supports all the features supported by the Vocieflow Knowledge Base API. You can find the full list of features in the Voiceflow Knowledge Base API Reference.

API Reference

You can find the full API reference in the API Reference Documentation

Contributing

Want to contribute to the project? That's awesome! Head over to our Contribution Guidelines.

Need support?

[!NOTE]
This repository depends on Google's Firebase Genkit. For issues and questions related to Genkit, please refer to instructions available in Genkit's repository.

Reach out by opening a discussion on GitHub Discussions.

Credits

This plugin is proudly maintained by Xavier Portilla Edo Xavier Portilla Edo.

License

This project is licensed under the Apache 2.0 License.

License: Apache 2.0