<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur" -->

---
title: Typed Arrows for AI Agent Memory | daily.dev
description: A deep-dive into the algebraic foundations of yigraf, a knowledge-graph tool designed to give AI coding agents persistent memory over a codebase's structure,...
canonical: https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Typed Arrows for AI Agent Memory | daily.dev
og:description: A deep-dive into the algebraic foundations of yigraf, a knowledge-graph tool designed to give AI coding agents persistent memory over a codebase's structure,...
og:url: https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur
og:image: https://api.daily.dev/og/posts/5DJiVqDUr.png
og:image:alt: Typed Arrows for AI Agent Memory
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Typed Arrows for AI Agent Memory

**[Medium](https://daily.dev/sources/medium_js)** · 15 min read · 0 upvotes · 0 comments

## Summary

A deep-dive into the algebraic foundations of yigraf, a knowledge-graph tool designed to give AI coding agents persistent memory over a codebase's structure, intent, plans, and rationale. The post develops a typed graph where edges carry relation types with formal signatures, a partial (non-associative) composition operator modeled as a deterministic automaton, and a max-min bottleneck semiring for grading confidence in derived conclusions. It also covers a convergent belief algebra built on a grow-only CRDT log, and explains why typed lambda calculus types — but not its reduction engine — are the right inspiration for this system.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ricstalt.medium.com/typed-arrows-for-ai-agent-memory-e0b22915d75b>

## Questions this post answers

### How can a knowledge graph represent different confidence levels for facts versus inferred conclusions?

A three-element bottleneck (max-min) semiring ranks confidence as AMBIGUOUS below INFERRED below EXTRACTED, with path composition using min (the weakest link dominates) and choosing between paths using max (the best path wins). Any multi-hop derived path is additionally capped at INFERRED even if every individual link is EXTRACTED, since a logical consequence is not itself an asserted fact.

_Anyone designing trust-graded reasoning over code graphs can find related architecture discussions on daily.dev._

### Why would composing two relations in a typed graph not be associative?

Because composition is defined as a hand-chosen, deliberately conservative partial function rather than the free composition of relations. For the word implements-contains-calls, folding left gives implements∘contains=implements then implements∘calls=depends_on, while folding right gives contains∘calls=undefined, so implements∘undefined is also undefined. The two bracketings disagree, making the structure a partial magma rather than a category.

_Developers modeling code dependency graphs can explore composition algebra discussions like this on daily.dev._

## Similar posts on daily.dev

- [How to use AI agents better than 99% of people](https://daily.dev/posts/how-to-use-ai-agents-better-than-99-of-people-5tzhgrsk9) · System Design Newsletter · 1 upvotes · 0 comments
- [Agent Memory Is Only as Good as Its Schema](https://daily.dev/posts/agent-memory-is-only-as-good-as-its-schema-vamsh2ow0) · Daily Dose of Data Science \| Avi Chawla \| Substack · 0 upvotes · 0 comments
- [Context Graphs & Agentic Decisions](https://daily.dev/posts/context-graphs-agentic-decisions-ve9azxujl) · neo4j · 1 upvotes · 0 comments
- [Knowledge graph RAG: structured retrieval for AI agents](https://daily.dev/posts/knowledge-graph-rag-structured-retrieval-for-ai-agents-k6cymxiik) · Redis · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#graph-theory](https://daily.dev/tags/graph-theory)

[View this post on daily.dev](https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Typed Arrows for AI Agent Memory","url":"https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur"},"datePublished":"2026-08-02T20:53:53.533Z","dateModified":"2026-09-13T21:07:25.651Z","description":"A deep-dive into the algebraic foundations of yigraf, a knowledge-graph tool designed to give AI coding agents persistent memory over a codebase's structure,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f512985eb6819df3fd9648f0a9a321b9?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f512985eb6819df3fd9648f0a9a321b9?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,graph-theory","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Typed Arrows for AI Agent Memory"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/typed-arrows-for-ai-agent-memory-5djivqdur#faq","mainEntity":[{"@type":"Question","name":"How can a knowledge graph represent different confidence levels for facts versus inferred conclusions?","acceptedAnswer":{"@type":"Answer","text":"A three-element bottleneck (max-min) semiring ranks confidence as AMBIGUOUS below INFERRED below EXTRACTED, with path composition using min (the weakest link dominates) and choosing between paths using max (the best path wins). Any multi-hop derived path is additionally capped at INFERRED even if every individual link is EXTRACTED, since a logical consequence is not itself an asserted fact. Anyone designing trust-graded reasoning over code graphs can find related architecture discussions on daily.dev."}},{"@type":"Question","name":"Why would composing two relations in a typed graph not be associative?","acceptedAnswer":{"@type":"Answer","text":"Because composition is defined as a hand-chosen, deliberately conservative partial function rather than the free composition of relations. For the word implements-contains-calls, folding left gives implements∘contains=implements then implements∘calls=depends_on, while folding right gives contains∘calls=undefined, so implements∘undefined is also undefined. The two bracketings disagree, making the structure a partial magma rather than a category. Developers modeling code dependency graphs can explore composition algebra discussions like this on daily.dev."}}]}
```

