Skip to content

sciphi cloud setup

This guide shows you how to set up SciPhi Cloud (hosted R2R) for your Supen knowledge base.

  1. Go to https://app.sciphi.ai
  2. Click “Sign Up” (free tier available, no credit card required)
  3. Verify your email
  4. Log in to the dashboard
  1. In the SciPhi dashboard, navigate to “Settings” or “API Keys”
  2. Click “Create API Key”
  3. Give it a name (e.g., “Supen Production”)
  4. Copy the API key - you won’t see it again!
  5. Save it securely

Add to your app/.env.local:

Terminal window
# SciPhi Cloud Configuration
R2R_API_URL=https://api.sciphi.ai
R2R_API_KEY=your_api_key_here

In your Railway dashboard:

  1. Go to your Supen service
  2. Click “Variables”
  3. Add these environment variables:
R2R_API_URL=https://api.sciphi.ai
R2R_API_KEY=your_api_key_here
  1. Click “Deploy”

Run this test to verify everything works:

Terminal window
# Start your Supen dev server
pnpm dev
# In another terminal, test the health endpoint
curl http://localhost:3333/api/knowledge/health

You should see:

{
"available": true,
"provider": "R2R",
"baseUrl": "https://api.sciphi.ai"
}
Terminal window
curl -X POST http://localhost:3333/api/knowledge/documents \
-F "file=@/path/to/your/document.pdf" \
-F "useHiResMode=true"
  1. Go to http://localhost:3333/knowledge (once we build the UI)
  2. Click “Upload Document”
  3. Select your PDF
  4. Enable “Complex Layout Mode” for PDFs with tables/images
  5. Click “Upload”
Terminal window
curl -X POST http://localhost:3333/api/knowledge/query \
-H "Content-Type: application/json" \
-d '{
"query": "What is this document about?",
"limit": 5
}'

Once configured, Supen provides these knowledge endpoints:

GET /api/knowledge/health # Check R2R availability
GET /api/knowledge/collections # List knowledge bases
POST /api/knowledge/collections # Create knowledge base
GET /api/knowledge/documents # List documents
POST /api/knowledge/documents # Upload document
GET /api/knowledge/documents/:id # Get document details
DELETE /api/knowledge/documents/:id # Delete document
POST /api/knowledge/search # Search (no generation)
POST /api/knowledge/query # RAG query (with generation)

Vibex agents can automatically use knowledge context:

import { getKnowledgeService } from "@/lib/r2r";
// In your agent code
const knowledgeService = getKnowledgeService();
// Search for relevant context
const context = await knowledgeService.search(
userQuery,
{ workspaceId, limit: 5 }
);
// Use context in agent system prompt
const systemPrompt = `
You are an AI assistant with access to the following knowledge:
${context.map(c => c.text).join("
")}
Use this knowledge to answer the user's question accurately.
`;

Free Tier:

  • Generous document storage
  • Standard retrieval speed
  • Community support

Paid Plans:

  • Larger document limits
  • Faster processing
  • Priority support
  • Advanced features (knowledge graphs, etc.)

Check https://www.sciphi.ai/pricing for current limits.

Check:

  1. Is R2R_API_URL set correctly? (should be https://api.sciphi.ai)
  2. Is R2R_API_KEY valid?
  3. Test directly: curl https://api.sciphi.ai/v3/health

Check:

  1. File size limits (check SciPhi dashboard for your plan limits)
  2. Supported file types (PDF, DOCX, TXT, MD, etc.)
  3. API key has write permissions

This is normal for complex PDFs:

  • Hi-res mode with table extraction takes longer
  • Check document status: GET /api/knowledge/documents/:id
  • Status will change from “processing” → “completed”

Make sure:

  1. API key is in environment variables (not hardcoded)
  2. API key has correct format (Bearer token)
  3. API key hasn’t expired
  1. Never commit API keys - Use environment variables
  2. Rotate keys regularly - Create new keys periodically
  3. Use different keys - Dev vs Production
  4. Monitor usage - Check SciPhi dashboard for unusual activity
  5. Limit access - Only give keys to necessary services
  • Build the knowledge UI for document management
  • Integrate knowledge retrieval into Vibex agents
  • Set up automated document ingestion pipelines
  • Configure project-specific knowledge bases