pinecone-vercel-starter  by pinecone-io

Full-stack app for RAG-based chatbot using Pinecone and Vercel AI SDK

created 2 years ago
478 stars

Top 64.9% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a starter template for building a Retrieval Augmented Generation (RAG) chatbot using Pinecone and Vercel's AI SDK. It's designed for developers looking to create context-aware chatbots that can access and utilize domain-specific knowledge, reducing hallucinations and improving response accuracy.

How It Works

The application leverages a Next.js frontend with Vercel's AI SDK for efficient streaming. A backend API endpoint handles chat requests, integrating with OpenAI's API for generative responses. The core RAG functionality is implemented by a web crawler that scrapes provided URLs, chunks the content, generates embeddings, and stores them in a Pinecone index. When a user asks a question, the system retrieves relevant chunks from Pinecone based on the query's embedding, prepends this context to the prompt, and sends it to the LLM for a grounded response.

Quick Start & Requirements

  • Install: npm install
  • Run: npm run dev
  • Prerequisites: Node.js, OpenAI API Key (set as OPENAI_API_KEY environment variable), Pinecone API Key and Environment (set as PINECONE_API_KEY and PINECONE_ENVIRONMENT environment variables), Pinecone Index Name (set as PINECONE_INDEX environment variable).
  • Setup: Requires configuring environment variables for OpenAI and Pinecone. Crawling and indexing can take time depending on the size of the target website.
  • Docs: Full code listing

Highlighted Details

  • Integrates Pinecone for vector storage and retrieval.
  • Utilizes Vercel AI SDK for streamlined chatbot development and streaming.
  • Implements a web crawler to populate the knowledge base from URLs.
  • Supports two chunking strategies: RecursiveCharacterTextSplitter and MarkdownTextSplitter.
  • Includes end-to-end testing with Playwright.

Maintenance & Community

  • Maintained by Pinecone.
  • No specific community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

  • The repository itself is not explicitly licensed in the provided README. However, it utilizes libraries with various licenses (e.g., OpenAI, Vercel AI SDK, Next.js). Users should verify the licenses of all dependencies for commercial use.

Limitations & Caveats

  • The README does not specify the license for the starter template itself, which could be a concern for commercial adoption.
  • Error handling for Pinecone index creation and querying could be more robust.
  • The default system prompt is quite verbose and might need tuning.
Health Check
Last commit

7 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
19 stars in the last 90 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
1 more.

promptable by cfortuner

0%
2k
TS/JS library for building full-stack AI apps
created 2 years ago
updated 2 years ago
Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX).

chatgpt-pgvector by gannonh

0%
938
Domain-specific chat completions app
created 2 years ago
updated 2 years ago
Feedback? Help us improve.