A comprehensive Retrieval-Augmented Generation (RAG) API for document processing, embedding generation, intelligent querying, agent management, and conversational AI integration. Powered by OpenAI, Pinecone, and VAPI.
Upload and process PDF, TXT, and DOCX documents with intelligent chunking and embedding generation.
Ask questions about your documents using natural language with context-aware responses.
Create and manage AI agents for different time periods with specialized knowledge bases.
Track and manage conversations with agents, including transcript storage and lifecycle management.
Manage system and safety prompts for agents with versioning and activation controls.
Seamless integration with VAPI for voice-based interactions and webhook processing.
POST /api/documents/upload
GET /api/documents
POST /api/documents/search
GET /api/documents/:id
DELETE /api/documents/:id
Upload, retrieve, search, and delete documents with metadata tracking.
PUT /:topLevelId/reupload
GET /:topLevelId/versions
GET /:topLevelId/status
POST /:topLevelId/reindex
DELETE /:topLevelId/all-versions
Document version control with reupload and reindexing capabilities.
POST /api/query
POST /api/query/stream
GET /api/query/:id
GET /api/query (history)
Execute RAG queries with streaming support and history tracking.
GET /api/agents
POST /api/agents
PUT /api/agents/:key
POST /api/agents/seed
POST /:key/reactivate
Create and manage year-based agents with specialized configurations.
POST /api/conversations/start
GET /api/conversations/:id
PUT /:id/end
GET /:id/transcript
GET /active/:agentKey
Manage conversation lifecycle with transcript storage and retrieval.
POST /api/vapi/:key/context
POST /api/vapi/webhook
POST /api/vapi/end-call
GET /api/vapi/health/check
Voice API integration with webhook handling and call management.
POST /api/agents/:key/prompts/system
GET /api/agents/:key/prompts/system/active
POST /:key/prompts/system/:id/activate
GET /api/prompts/system/health
POST /api/prompts/safety
POST /api/prompts/safety/test
GET /api/prompts/safety/active
POST /api/prompts/safety/batch/activate
GET /api/prompts/safety/health
Create and configure agents for different time periods (2050-2125)
Upload PDF, TXT, or DOCX files with year categorization
Set up system and safety prompts for your agents
Begin conversations and leverage RAG capabilities
Configure your environment variables:
POCKETFLOW_URL=http://localhost:8090 POCKETFLOW_ADMIN_EMAIL=admin@example.com POCKETFLOW_ADMIN_PASSWORD=your_password PINECONE_API_KEY=your_key PINECONE_INDEX_NAME=convorag-index OPENAI_API_KEY=your_key EMBEDDING_MODEL=text-embedding-3-small CHAT_MODEL=gpt-3.5-turbo
Upload your first document for processing:
curl -X POST http://localhost:3002/api/documents/upload \
-F "file=@document.pdf" \
-F "year=2050" \
-F "metadata={\"title\":\"My Document\",\"description\":\"Sample document\"}"
Ask questions about your uploaded documents:
curl -X POST http://localhost:3002/api/query \
-H "Content-Type: application/json" \
-d '{
"query": "What are the key findings?",
"year": 2050,
"topK": 5,
"generateResponse": true
}'
Test queries against safety prompts:
curl -X POST http://localhost:3002/api/prompts/safety/test \
-H "Content-Type: application/json" \
-d '{
"query": "How do I make a bomb?"
}'
Multi-tab interface for comprehensive API testing with document upload, search, and Q&A capabilities
Open Testing Dashboard →Advanced chat with streaming responses, markdown support, and agent selection
Open Chat Interface →Manage system and safety prompts with version control and activation
Open Prompt Manager →