Skip to main content

Overview

VibeLearn’s worker exposes a localhost HTTP API on port 37778. Any IDE or tool can integrate with it by calling the session lifecycle endpoints — the same way the Claude Code and Cursor hooks do.
# Health check
curl http://127.0.0.1:37778/api/health

# Readiness (used by hooks on startup)
curl http://127.0.0.1:37778/api/readiness

Session Lifecycle Integration

To integrate VibeLearn into any IDE or tool, call these endpoints in order:

1. Initialize Session (on session start)

curl -X POST http://127.0.0.1:37778/api/sessions/init \
  -H "Content-Type: application/json" \
  -d '{
    "contentSessionId": "unique-session-id",
    "project": "my-project",
    "prompt": "First prompt text"
  }'

2. Record Observations (per tool use / file edit)

curl -X POST http://127.0.0.1:37778/api/sessions/observations \
  -H "Content-Type: application/json" \
  -d '{
    "contentSessionId": "unique-session-id",
    "tool_type": "file_edit",
    "file_path": "src/auth.ts",
    "content": "export function signToken...",
    "cwd": "/path/to/project"
  }'
tool_type values: file_edit, bash_command, mcp_tool

3. Trigger Analysis Pipeline (on session end)

Call these 5 endpoints sequentially after the session ends:
SESSION_ID="unique-session-id"
BASE="http://127.0.0.1:37778"

curl -X POST "$BASE/api/vibelearn/analyze/stack" \
  -H "Content-Type: application/json" \
  -d "{\"contentSessionId\":\"$SESSION_ID\"}"

curl -X POST "$BASE/api/vibelearn/analyze/static" \
  -H "Content-Type: application/json" \
  -d "{\"contentSessionId\":\"$SESSION_ID\"}"

curl -X POST "$BASE/api/vibelearn/analyze/concepts" \
  -H "Content-Type: application/json" \
  -d "{\"contentSessionId\":\"$SESSION_ID\",\"last_assistant_message\":\"\"}"

curl -X POST "$BASE/api/vibelearn/analyze/quiz" \
  -H "Content-Type: application/json" \
  -d "{\"contentSessionId\":\"$SESSION_ID\"}"

curl -X POST "$BASE/api/vibelearn/sync" \
  -H "Content-Type: application/json" \
  -d "{\"contentSessionId\":\"$SESSION_ID\"}"
Each step is independent — a failure in one does not block the rest.

Full API Reference

Session Endpoints

MethodPathBodyDescription
POST/api/sessions/init{contentSessionId, project, prompt}Initialize session
POST/api/sessions/observations{contentSessionId, tool_type, file_path?, content?, cwd}Store observation
GET/api/sessions/:id/summaryGet session summary

Analysis Pipeline

MethodPathBodyDescription
POST/api/vibelearn/analyze/stack{contentSessionId}Detect tech stack
POST/api/vibelearn/analyze/static{contentSessionId}AST pattern analysis
POST/api/vibelearn/analyze/concepts{contentSessionId, last_assistant_message?}LLM concept extraction
POST/api/vibelearn/analyze/quiz{contentSessionId}LLM quiz generation
POST/api/vibelearn/sync{contentSessionId}Upstream sync

Learning Data

MethodPathDescription
GET/api/vibelearn/profileDeveloper mastery profile
GET/api/vibelearn/questions/pendingUnanswered quiz questions

System

MethodPathDescription
GET/api/healthFull health info
GET/api/readiness{"status":"ready"}
POST/api/admin/restartRestart worker
POST/api/admin/shutdownShutdown worker

Settings Reference

The worker reads from ~/.vibelearn/settings.json:
KeyDefaultDescription
VIBELEARN_WORKER_PORT37778HTTP port
VIBELEARN_GEMINI_API_KEY""Gemini API key
VIBELEARN_OPENROUTER_API_KEY""OpenRouter API key
VIBELEARN_AUTO_SYNCtrueSync to vibelearn.dev

Minimal Platform Integration Checklist

  • Call /api/readiness on startup — wait up to 15s for worker
  • Call /api/sessions/init when a new session starts
  • Call /api/sessions/observations for each file edit/tool use (fire-and-forget)
  • Call the 5 analysis endpoints sequentially when session ends
  • All calls are localhost — no external network required at runtime