Long-term memory for an AI agent

Nous keeps episodes, facts, procedures, censors and working memory in PostgreSQL with pgvector, and finds them again by full-text, vector and graph search.

Runs on PostgreSQL 17 with pgvector.

Five kinds of Nous memory. Each with its own lifecycle.

Episodes: memory of what happened

Each conversation is summarised into an episode. Keeping the verbatim transcript in chunks beside it is opt-in.

Facts: memory that gets superseded

Facts are scored before they are stored, and a newer fact that contradicts an older one replaces it.

Procedures: memory of skills

Learned K-lines, and skills taught with learn_skill from a URL, a file or inline markdown.

Censors: memory that blocks actions

A censor is a "don't do this" rule, made when Nous finds a failure mode. It blocks a matching action.

Working memory holds the task

The state of the current task, cleaned up on a timer once the work is done.

Hybrid recall across Nous memory

Full-text and vector results are fused by Reciprocal Rank Fusion, with a relevance floor and a staleness penalty.

Recall then spreads through the knowledge graph from facts to decisions, episodes and procedures, and shows contradictions as it goes. The context engine fits what it found into a token budget for the turn's frame.

See the turn loop

Facts that change

When a newer fact contradicts an older one, Nous marks the older fact superseded and ranks it below the newer one, so recall serves what holds now and the old fact is still there to read.

Sleep consolidates Nous memory

When Nous has been idle for two hours by default, it sleeps. The sleep cycle reorganises memory instead of answering anyone.

A reviewable changelog of what each cycle changed is opt-in, as the consolidation audit.

How Nous learns a procedure in 3 steps

1. Finds a lesson

From clusters of successful decisions, episode lessons and error recoveries.

2. Passes the lesson gate

The gate wants cited evidence and refuses a lesson that an existing procedure already teaches.

3. Lives as a procedure

Procedures track how well they work. Weak or stale ones are reviewed, then revised or retired.