Peufy Cortex · Observability Layer

Observablecognition for AI.

One universal schema for every agent, model and tool call. Replay any session, surface hallucinations, and reason about your AI like a distributed system — not a black box.

Start free →
$ pnpm add @peufy/cortex
typescriptpythonkotlingo
Live event stream · cognition.events
[observation.perceive][judgement.evaluate][action.execute][incident.detect][lifecycle.start][meta.snapshot][judgement.reject][observation.ingest][action.tool_call][incident.hallucinate][observation.perceive][judgement.evaluate][action.execute][incident.detect][lifecycle.start][meta.snapshot][judgement.reject][observation.ingest][action.tool_call][incident.hallucinate][observation.perceive][judgement.evaluate][action.execute][incident.detect][lifecycle.start][meta.snapshot][judgement.reject][observation.ingest][action.tool_call][incident.hallucinate]
$peufy/replay/studiolive
replay-studio · ses_01HZ3K8A
Status
FAILED
Reliability
42/100
events.log
9
  • 00.230intent.formed
  • 01.120context.shifted
  • 01.810inference.requested
  • 02.190tool.started
  • 03.460tool.completed
  • 03.900context.shifted
  • 04.210incident.raised
  • 05.120judgement.recorded
  • 05.980output.emitted
behavioral.timeline
06.480s
0s1s2s3s4s5s6s
Intent Formed
Context Shifted
Inference Requested
Tool Executed
Context Shifted
Incident Raised
Judgement Recorded
Output Emitted
root_cause

grounding confidence collapsed after retry cascade.

impact.json
  • tools_affected: 2
  • retry_cascade: 1
  • hallucinations: 1
  • users_impacted: 1
causality.graph
ICTIRO
00:04.210 / 00:06.480
1.0×
· 01 / The problem

Every AI categoryinvents its ownlogging schema.

LLM observability vendors. Agent frameworks. Eval harnesses. RAG tooling. Each ships its own taxonomy — and none of them speak to each other. Scroll to see Cortex collapse them into one vocabulary.

6 schemas · 1 outcome
cortex.collapse(*)collapsing
datadog
{ "type": "llm_call", "ms": 412 }
langchain
{ "event": "tool.run", "args": {…} }
internal
{ "kind": "agent_step", "thought": "…" }
ragas
{ "trace_id": "abc-91", "ok": true }
guardrails
{ "evt": "guardrail_block" }
vendor-x
{ "type": "retrieval", "k": 8 }
cortex.eventsv0.4.2
observation.perceive{ source: "user" }
judgement.evaluate{ score: 0.84 }
action.tool_call{ tool: "search" }
incident.detect{ kind: "drift" }
lifecycle.snapshot{ turn: 14 }
one schema · every runtimelive
· 02 / Universal vocabulary

Six classes. Onebehavioral grammar for AI.

Cortex models AI behavior as a small, finite set of verbs — shared across LLMs, agents, RAG pipelines and human review. Hover a class to inspect its verbs.

cortex.lifecycle.*
5 verbs

lifecycle

Session and turn boundaries. Use these verbs from any SDK; they normalize across runtimes and producers.

01cortex.lifecycle.session.start()
02cortex.lifecycle.session.end()
03cortex.lifecycle.turn.open()
04cortex.lifecycle.turn.close()
05cortex.lifecycle.snapshot()
.session.start.session.end.turn.open.turn.close.snapshot
Ξ
· 04 / Debugging intelligence

Three lenses for whyyour AI behaved that way.

Cortex doesn't just store events — it interprets them. Three integrated debuggers turn raw behavioral data into actionable, audit-ready intelligence.

01 / 03

Suspicion Engine

Deterministic detectors catch hallucinations, tool misuse, and policy drift in real time — before they reach your user.

scan
live
hallucinationdriftpolicy
12 detector families · sub-second
02 / 03

Failure Inspector

Root-cause chains link a bad action back to the flawed observation or judgement that produced it. Traverse causality, not logs.

obsjdgactinc
causality
root-causetracedag
causal DAG · per-turn
03 / 03

Session Diagnosis

LLM-narrated period reports summarize agent drift across hours or weeks, with quoted evidence from the replay timeline.

narrative
Drift detected at turn 14 …
reportevidenceaudit
narrative · auditable
· 05 / SDKs

One fluent API.Every runtime.

Wrap any inference call in three lines. Cortex captures the full behavioural trace and normalises it into the universal schema — identical events across every language we ship.

same events · every language
cortex / example.ts
01// Drop-in instrumentation for any AI runtime
02import { cortex } from "@peufy/cortex";
03 
04await cortex.session("orion-7c1a")
05 .turn()
06 .input({ user: prompt })
07 .inference(async () => openai.chat(prompt))
08 .commit();
output · cortex.commit
cortex.session("orion-7c1a") opened
·turn 014 · observation.perceive captured
·judgement.evaluate · score 0.84
·action.tool_call → openai.chat() · 412 ms
commit · 1 turn · 4 events · schema v0.4.2
· 06 / Adapters

Plug into any stack.

10+ producers · 4 runtimesdrop-in · zero refactor
OpenAI
Anthropic
LangChain
LiteLLM
Vercel AI
LlamaIndex
OpenAI
Anthropic
LangChain
LiteLLM
Vercel AI
LlamaIndex
OpenAI
Anthropic
LangChain
LiteLLM
Vercel AI
LlamaIndex
Mistral
Cohere
Pinecone
Weaviate
Groq
Replicate
Mistral
Cohere
Pinecone
Weaviate
Groq
Replicate
Mistral
Cohere
Pinecone
Weaviate
Groq
Replicate
schema · v0.4.2one taxonomy / every runtimeopen · maintained
· 07 / Pricing

Pay per observed turn.Not per seat.

Cortex scales with the volume of behavior you record, not how many engineers happen to log in. Start free, upgrade when you ship.

Free

01

For solo builders shipping prototypes.

$0/mo
  • 1 project
  • 5k events / month
  • 7-day retention
  • Community support
Most chosen

Pro

02

Teams instrumenting production agents.

$49/mo
  • 5 projects
  • 1M events / month
  • 30-day retention
  • Suspicion Engine
  • Email support

Team

03

Cross-functional teams shipping AI products.

$249/mo
  • 20 projects
  • 10M events / month
  • 90-day retention
  • Failure Inspector
  • Session Diagnosis
  • Shared workspaces

Enterprise

04

Bring Cortex into a regulated environment.

Custom
  • Unlimited projects
  • Custom retention
  • SSO + audit log
  • Private cloud
  • Dedicated SE
usage-based · cancel anytimeno per-seat fees · no log ingest tax
· 08 / Frequently Asked

Questions, beforethe loop closes.

Everything you need to know about Cortex — the schema, the runtime, the deployment model. Still curious? Book a demo.

6 · indexed answers

Cortex is an observability layer for AI agents. It captures every cognitive event — perception, judgement, action, incident — in a universal schema so you can replay sessions, surface hallucinations, and reason about your AI like a distributed system.