API
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
-
Install dependencies:
bash
npm install -
Create a
.envfile with your credentials:Code
PINECONE_API_KEY=your_pinecone_api_key PINECONE_INDEX_NAME=your_pinecone_index -
Run the development server:
bash
npm run dev -
Open http://localhost:3000 to see the chat interface.
API Endpoints
Quick Reference
/api/chat- Chat API endpoint for the UI; queries Pinecone viapinecone/lib/query-handler.jsdirectly (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-deleteHTTP 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:
- Push to GitHub
- Connect to Vercel
- Set environment variables
- 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.