Skip to main content

One graph engine, two write paths.

A queryable knowledge base over your documents, and an agentic memory layer for Claude Code, Codex, and OpenCode.

Open source · Python 3.12 · MIT

One library. Two ways to use it.

The same engine powers two distinct use cases on the same artefacts. Pick where to start.

Knowledge base

Ask your documents

Point GRAIL at a folder of PDFs, markdown, or code. Index once, query through six search modes — including an agent that picks the right tool for each question.

KB quickstart →
Agentic memory

Give your agent memory

Persistent memory for your agents in Claude Code, Codex, or OpenCode. The agent declares entities and relationships directly — no intermediate LLM extraction step. Available as a Python SDK or as a ready-made skill for your framework.

Open source

Built in Chile, for the world

GRAIL is developed under the open-source commission of the Cámara Chilena de Inteligencia Artificial. MIT-licensed, no telemetry, no vendor lock-in.

Acknowledgements

Standing on others' shoulders

Technical inspiration

The single-pass LLM extraction of entities and relationships from text chunks in GRAIL's knowledge-base mode draws inspiration from Microsoft GraphRAG. Everything else — incremental updates, cascade retrieval, the agentic search loop, the agentic memory mode and its proposal-based consolidation, recall mode, typed relationships, retrieval queries on entities, honest cost tracking, file-level provenance, and the dual-write-path architecture — is GRAIL's own design.

Commission

GRAIL is developed under the open-source commission of the Cámara Chilena de Inteligencia Artificial. Author and creator: Benjamín González Guerrero, founder of Nirvai.

Sponsored byNirvaiVisit Nirvai →