Cognition Endpoints

REST API endpoints for reasoning, reflection, and pattern recognition.

POST

/v1/cognition/reason

Request

json
{
  "query": "What are the key insights?",
  "context": ["mem_abc123"],
  "reflection": true,
  "model": "gpt-4",
  "temperature": 0.7
}

Response

json
{
  "success": true,
  "data": {
    "answer": "The key insights are...",
    "reasoning": ["Step 1: ...", "Step 2: ..."],
    "confidence": 0.95,
    "tokensUsed": 1250
  }
}

Example

bash
curl -X POST https://api.cognitivex.ai/v1/cognition/reason \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Analyze sales trends",
    "reflection": true
  }'