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

@vectara/create-ui

v0.0.5

Published

The fastest way to generate a Vectara-powered sample codebase for a range of user interfaces

Downloads

352

Readme

Create-UI

Create-UI is the fastest way to generate a Vectara-powered sample codebase for a range of user interfaces:

  • Chat: A chat UI.
  • Semantic search: A typical search UI.
  • Summarized semantic search: A typical search UI preceded by a summary of the most relevant results. Perfect for users who want to scan an overview before digging deeper into interesting search results.
  • Question and answer: Ideal for users who want to ask a question and get a concise answer.

Use this tool to:

  • Run the UIs in your browser so you can compare them and choose the right one for your GenAI application.
  • Borrow from our patterns for retrieving data from Vectara, restructuring the data, and surfacing it to users.
  • Use the underlying code as a starting point or reference for building your UI.

[!TIP]

Looking for something else? Try another open-source project:

  • React-Chatbot: Add a compact Vectara-powered chatbot widget chat to your React apps.
  • React-Search: Add Vectara semantic search to your React apps with a few lines of code.
  • Vectara Answer: Demo app for Summarized Semantic Search with advanced configuration options.
  • Vectara Ingest: Sample templates and crawlers for pulling data from many popular data sources.

How to use

1. Install Node and NPM

Create-UI expects you to have Node and NPM installed on your system.

2. Generate a codebase

npx @vectara/create-ui

Follow the prompts in the command line to generate a React codebase. You can choose to use our sample data, which is ideal for folks who don't have a Vectara account yet. If you already have data in Vectara you can configure the UI to connect to it.

When the prompts are complete, run the build command provided to you. You'll see the UI running in your browser.

Types of UIs

Chat UI

The Chat UI is characterized by:

  • An input box for entering a natural-language query. This typically takes the form of a question.
  • A conversational thread based upon the most relevant search results and the conversational context. The most recent respons contains citations.

Semantic Search UI

The Semantic Search UI is characterized by:

  • A search box for entering a natural-language query. This can take the form of a question or just search terms.
  • A list of search results.

A user will typically scan the list for relevant results and dig deeper into any results that look interesting. They'll try variations on the same basic query to make sure they find as many potentially useful results as possible.

Summarized Semantic Search UI

The Summarized Semantic Search UI is characterized by:

  • A search box for entering a natural-language query. This can take the form of a question or just search terms.
  • A list of search results.
  • A summary of search results that are most relevant to the query, with citations.

A user will typically scan the summary for points of interest, which is faster than reviewing the list of search results. If an aspect of the summary catches their eye, they'll dig deeper into the cited search result. They'll repeat this pattern until they've reviewed all of the interesting information that was relevant to their query.

Question and Answer UI

The Question and Answer UI is characterized by:

  • A search box for entering a natural-language query. This typically takes the form of a question.
  • A condensed answer based upon the most relevant search results, with citations.

A user will typically scan the answer to see if it truly answers their question. They'll use the citations to verify that the answer is grounded in facts. If the answer doesn't fully answer their question they'll try again with a differently-worded question.

Set up your data in Vectara

You can configure a Create-UI app to use our sample data or to pull data from your Vectara corpus. To set this up:

  1. Create a free Vectara account.
  2. Create a corpus and add data to it.
  3. Create a QueryService API key.

Pro-tip: After you create an API key, navigate to your corpus and click on the "Access control" tab. Find your API key on the bottom and select the "Copy all" option to copy your customer ID, corpus ID, and API key. This gives you all the data you need to configure a Create-UI app.

Copy all option

How to use metadata

Vectara enables you to define metadata on your documents. Create-UI apps behave differently based on the presence of specific metadata fields:

  • title: If this field is defined it will be rendered as the title of a search result. Typically this is something like the title of the document or webpage.
  • url: If this field is defined, the UI will render the search result as a link to the defined URL.

License

Create-UI is an open-sourced software licensed under the Apache 2.0 license.

This repository contains sample code that can help you build UIs powered by Vectara, and is licensed under the Apache 2.0 License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.