๐Ÿ”Œ Client Microservice

External Application Consuming Ontology Server

Client Service: https://dev-ontology-api.pocketp.ai โ€” fetches data from Ontology Server at https://dev-ontology.pocketp.ai

๐Ÿ“ก Available Endpoints

GET /api/pillars

Get all 8 foundational pillars

GET /api/pillars/:id

Get a specific pillar by ID (1-8)

GET /api/virtues

Get all 15 core virtues

GET /api/virtues/:id

Get a specific virtue by ID (1-15)

GET /api/frameworks

Get all 9 ethical frameworks

GET /api/guardrails

Get all safety guardrails

GET /api/guardrails/non-negotiable

Get only non-negotiable guardrails

GET /api/triggers

Get escalation triggers

GET /api/invariants

Get global invariants (non-bypassable rules)

GET /api/growth-stages

Get 6 moral growth stages

GET /api/engines

Get all reasoning engines (incl. ThinkingAnalysisEngine, EmpathySimulationEngine, SecondOrderEffectsEngine, and more)

GET /api/stats

Get ontology statistics

GET /api/validate

Run validation tests

POST /api/evaluate

Evaluate a moral scenario

GET /api/classes

Search dataset alignment classes (14,343 at 100% coverage). Use ?q=ClassName to filter

GET /api/classes/:name

Look up a specific ontology class by name (e.g. BoundarySetting, BurnoutCascade)

๐Ÿงช Test Endpoints

๐Ÿ’ป Code Examples

JavaScript/Node.js

// Fetch all pillars
fetch('https://dev-ontology-api.pocketp.ai/api/pillars')
  .then(res => res.json())
  .then(pillars => console.log(pillars));

// Fetch specific virtue
fetch('https://dev-ontology-api.pocketp.ai/api/virtues/1')
  .then(res => res.json())
  .then(virtue => console.log(virtue));

// Evaluate a scenario
fetch('https://dev-ontology-api.pocketp.ai/api/evaluate', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    scenario: "A user asks for help with something potentially harmful"
  })
})
  .then(res => res.json())
  .then(evaluation => console.log(evaluation));
      

Python

import requests

# Fetch all pillars
pillars = requests.get('https://dev-ontology-api.pocketp.ai/api/pillars').json()
print(pillars)

# Fetch guardrails
guardrails = requests.get('https://dev-ontology-api.pocketp.ai/api/guardrails').json()
for g in guardrails:
    print(f"{g['name']}: {g['type']}")

# Evaluate scenario
response = requests.post('https://dev-ontology-api.pocketp.ai/api/evaluate', json={
    'scenario': 'A user asks for help with something potentially harmful'
})
print(response.json())
      

cURL

# Get all pillars
curl https://dev-ontology-api.pocketp.ai/api/pillars

# Get specific virtue
curl https://dev-ontology-api.pocketp.ai/api/virtues/1

# Get non-negotiable guardrails
curl https://dev-ontology-api.pocketp.ai/api/guardrails/non-negotiable

# Evaluate scenario
curl -X POST https://dev-ontology-api.pocketp.ai/api/evaluate \
  -H "Content-Type: application/json" \
  -d '{"scenario": "User asks for harmful content"}'