API

the store for data
1 minute ago

theunpartyapi.unparty.app

Challenge Learn, Design, and Build a RAG-Model Query API with Chat Interface

This unppp works as an API that connects to Pinecone vector database for semantic similarity search, along with a chat interface built with Next.js and the AI SDK.

Features

  • Pinecone vector database integration
  • In-memory caching for optimized performance
  • Real-time chat interface
  • Custom AI models that search your knowledge base

Getting Started

  1. Install dependencies:

    bash

    npm install
  2. Create a .env file with your credentials:

    Code

    PINECONE_API_KEY=your_pinecone_api_key
    PINECONE_INDEX_NAME=your_pinecone_index
  3. Run the development server:

    bash

    npm run dev
  4. Open http://localhost:3000 to see the chat interface.

API Endpoints

Quick Reference

  • /api/chat - Chat API endpoint for the UI; queries Pinecone via pinecone/lib/query-handler.js directly (in-process, not a separate HTTP route)
  • /api/images - Serves/generates OG-style images

Content upsert into Pinecone is not an HTTP route — it runs via pinecone/scripts/*.js CLI scripts, either manually or via .github/workflows/upsert-runway-files.yml on push to theunpartyrunway/**. See CLAUDE.md for the full architecture.

The standalone /api/pinecone-upsert, /api/pinecone-query, /api/pinecone-embed, and /api/pinecone-delete HTTP routes this section used to document were removed 2025-11-19 and no longer exist.

Key Features

  • Vector Similarity Search: Semantic search over Pinecone with in-memory caching
  • In-Memory Caching: Optimized response times with automatic cache cleanup
  • Error Handling: Comprehensive error handling and fallback strategies

Deployment

This application is ready to deploy on Vercel:

  1. Push to GitHub
  2. Connect to Vercel
  3. Set environment variables
  4. Deploy

UNPARTY Ecosystem

This repository is part of the UNPARTY ecosystem. For comprehensive documentation including architecture, integration points, business value alignment, and relationships to other UNPARTY repositories, see ECOSYSTEM.md.

Quick Links

  • CLAUDE.md - Architecture and AI development guidelines

License

This project is licensed under the terms of the license included in the repository.