How to Build an AI Employee With a Knowledge Graph (Not Just Another Agent)
An AI agent can take an action. An AI employee needs to know what happens next. Most AI agents look something like this: Think → Act → Observe → Repeat That's fine for short-lived tasks. But an AI employee needs to work across hours, days, and weeks. It needs to remember: What happened Who owns the work What is waiting What changed What should happen next When it should wake up When a human needs to approve something That's where graph engineering becomes interesting. This is the architecture behind Roster : software that can own work the way an employee does, not just fire off a single tool call. Events wake someone up. A graph holds state, ownership, and history. The agent reasons, acts, writes the result back, then sleeps until the next event. For Roster, the loop looks like this: Event ↓ Graph ↓ Agent ↓ Action ↓ Graph Update ↓ Sleep ↓ Wake Again Let's build a tiny version. Table of Contents 1. Model the Work 2. Build the Graph 3. Add Events 4. Build the Agent Loop 5. Add Scheduling 6. Build a Tiny AI Employee 7. Put It Together 8. The Bigger Idea 1. Model the Work Imagine an AI employee called Maya. Her job is simple: Follow up with sales leads. Her world contains: Maya ↓ owns Lead ↓ belongs_to Company ↓ contacted Email ↓ replied_to Customer We don't need a massive graph database. We just need nodes and relationships. 2. Build the Graph Here's a minimal TypeScript graph: type Node = { id : string ; type : string ; data : Record < string , unknown > ; }; type Edge = { from : string ; to : string ; type : string ; }; class Graph { nodes = new Map < string , Node > (); edges : Edge [] = []; addNode ( node : Node ) { this . nodes . set ( node . id , node ); } connect ( from : string , type : string , to : string ) { this . edges . push ({ from , type , to }); } neighbors ( id : string ) { return this . edges . filter (( edge ) => edge . from === id ) . map (( edge ) => ({ relationship : edge . type , node : this . nodes . get ( edge . to ), })); } } Now create Maya