XRAPH/Fields/AI & Agents

AI & Agents

Agent runtimes, retrieval, knowledge graphs, gateways, evaluation and content safety, written in Go and composed as libraries rather than services.

Projects
6
Stars
4
Languages
Go
Focus area
Agent Knowledge Distillation & Graphing
01

The through-line

Knowledge distillation & graphing

These five projects are one question asked five ways: when an agent finishes an episode, what is worth keeping, and in what shape? Retrieval gets you the raw material. The graph is what makes it revisable a month later.

  1. 01RetrieveWeave pulls context from documents, vectors and prior claims, then assembles it against a token budget.
  2. 02ReasonCortex runs the episode with bounded working memory, approval checkpoints and a persona that stays consistent across runs.
  3. 03DistilThe episode compresses into typed claims. Each one keeps the observation it rests on and a confidence.
  4. 04GraphKGKit writes claims as nodes and edges with content-addressed identity, so the same fact from a second source lands in the same place.
02

Projects

6 in this field
Content safety

Shield

Content safety arranged in layers that can short-circuit, roughly the way people react to danger. Instincts catch injection and exfiltration in under 10ms. Awareness spots PII, topic and intent. Boundaries are hard deny lists. Values apply toxicity and brand rules, and judgment scores grounding and compliance last, because it is the expensive one.

Go2
Provider SDK

AI SDK

One Go client across providers, with the parts you end up writing anyway included: structured output through generics and JSON Schema, tool discovery from function signatures, multi-tier memory, budget tracking, circuit breakers and retries. Still alpha, so the API moves.

Go1
RAG engine

Weave

The RAG pipeline as swappable parts, covering loaders, chunkers, embedders, vector stores and retrievers, with token-budgeted assembly and citations at the end. Postgres, SQLite or memory for metadata; pgvector or memory for vectors. Runs standalone or as a Forge extension with its own HTTP surface.

Go1
Evaluation

Sentinel

Evaluation for LLM output: 22 scorers across eight scenario types, saved baselines so you can tell a prompt improvement from a regression, and five red-team generators that throw prompt injection, jailbreaks, PII extraction, hallucination bait and bias probes at your own system before someone else does.

Go0
AI gateway

Nexus

A gateway for LLM traffic that you compile into your own binary. Route across providers by cost, latency or priority; cache responses with optional semantic matching; redact PII and block prompt injection on the way through; enforce per-tenant budgets. It also exposes an OpenAI-compatible endpoint, so existing SDKs point at it unchanged.

Go0
Agent runtime

Cortex

An agent framework that describes an agent the way you would describe a colleague: what they can do, how they think, how they talk, what they notice, and what they habitually do when something happens. Runs, steps and tool calls are tracked end to end, checkpoints pause a run for human approval, and memory is scoped per agent per tenant.

Go0
03

Related Research

All research ↗
2026

The Human Model: A Compositional Architecture for Human-Emulating AI Agents

AI agent frameworks treat personality and reasoning style as prompt engineering problems. The agent is a system prompt, a set of tools, and a loop. This paper argues that is a dead end for production systems and presents The Human Model, a compositional architecture that decomposes agents into seven structured primitives drawn from cognitive science and personality psychology: Skills, Traits, Behaviors, Cognitive Styles, Communication Styles, Perception, and Personas. We describe Cortex, an open-source Go implementation with multi-tenancy, execution tracking, and human-in-the-loop checkpoints. A survey of cognitive architectures (SOAR, ACT-R, BDI), personality modeling research, and contemporary LLM frameworks shows that no existing system covers all seven dimensions. The Human Model fills that gap by applying validated psychological constructs as engineering primitives rather than prompt decorations.

Cortex
WhitepaperIn review
2025

Bounded Working Memory for Long-Horizon Agents

Argues that long-running agents degrade through attention dilution rather than capacity exhaustion, which would explain why a larger context window does not help. Separates working memory, summarised history and graphed claims, and sets out the measurement that would settle the claim.

CortexWeave
WhitepaperDraft
2024

Short-Circuiting Safety Layers for Agent Input and Output

An ordering argument for content safety: detectors sorted by cost and precision, with an admissibility condition governing early termination. Argues the primary benefit is single-cause attribution rather than latency, and reports the replicated finding that deny lists outperform classifiers.

ShieldSentinelCortex
WhitepaperDraft
2024

Distilling Agent Episodes into Provenance-Bearing Graphs

A construction for compressing an agent episode into typed claims that retain the observations they rest on, written as graph edges a later contradiction can locate and revise. Bounds revision cost by the transitive support closure and is explicit about where the independence assumption fails.

Cortex
WhitepaperDraft
2023

Content-Addressed Node Identity for Multi-Source Knowledge Graphs

Deriving node identity from a normalised natural key rather than allocating it makes multi-source ingestion idempotent, order independent and convergent. Analyses the two places it fails, and argues the error asymmetry requires strictness by default.

Fabriq
Technical noteDraft