A self-building knowledge graph agent. Merges the autonomous loop pattern from Ralph with the graph memory engine from Cortex.
Tasty is an agent that loops autonomously, discovering and storing knowledge into a living graph. Each iteration enriches the graph β auto-linking related concepts, decaying stale info, and generating briefings that inform future iterations. The graph builds itself over time.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TASTY AGENT LOOP β
β β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββ β
β β 1. Brief βββββΆβ 2. Think βββββΆβ 3. Discover β β
β β (Cortex β β (Plan β β (Explore source β β
β β briefing)β β next β β material, run β β
β β β β moves) β β tools, read) β β
β ββββββββββββ ββββββββββββ ββββββββββ¬ββββββββββ β
β β² β β
β β ββββββββββββ ββββββββββΌββββββββββ β
β β β 5. Link ββββββ 4. Store β β
β ββββββββββββ (Auto- β β (Create nodes β β
β β linking β β & edges in β β
β β + decay)β β Cortex graph) β β
β ββββββββββββ ββββββββββββββββββββ β
β β
β Each iteration = fresh context, persistent graph β
β Inspired by Ralph (github.com/snarktank/ralph) β
β Powered by Cortex (github.com/MikeSquared-Agency/cortex)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Loop (from Ralph)
Like Ralph, each iteration spawns a fresh agent instance with clean context. Memory persists not in the agent's context window, but in the graph. This means:
- No context window overflow β the graph is the memory
- Each iteration starts with a Cortex briefing β a tailored summary of what matters right now
- Progress is tracked via the graph itself, not a flat file
- The agent can run indefinitely, growing smarter with each loop
The Graph (from Cortex)
Instead of storing progress in progress.txt and prd.json like Ralph, Tasty uses Cortex's graph memory:
- Nodes β facts, decisions, discoveries, questions, tasks
- Edges β relationships discovered automatically via embedding similarity
- Decay β unused knowledge fades, important knowledge persists
- Briefings β each iteration starts with "what do I need to know?"
- Hybrid search β vector similarity Γ graph proximity
- Python 3.10+
- Cortex installed and running
- An LLM API key (OpenAI, Anthropic, or local)
git clone https://github.com/robot-rubik/tasty.git
cd tasty
pip install -r requirements.txtcp config.example.toml config.toml
# Edit config.toml with your settings# Start Cortex first
cortex init
cortex serve
# Run Tasty with a seed topic
python tasty.py --seed "Learn about the authentication system in this codebase"
# Or run the bash loop (Ralph-style) for autonomous operation
./tasty.sh --max-iterations 20 --seed "Map out the entire API surface"[cortex]
host = "localhost"
port = 9090
agent_name = "tasty"
[llm]
provider = "openai" # openai | anthropic | local
model = "gpt-4o"
api_key_env = "OPENAI_API_KEY"
[loop]
max_iterations = 50
min_new_nodes_per_iteration = 1
stop_on_no_discoveries = true
briefing_token_budget = 2000
[graph]
default_importance = 0.5
discovery_importance = 0.7
decision_importance = 0.8
question_importance = 0.6
decay_enabled = true
auto_link_threshold = 0.75Each iteration follows this cycle:
The agent requests a Cortex briefing β a synthesized summary of the most relevant knowledge for the current task context. This replaces Ralph's progress.txt with a dynamic, context-aware summary.
Using the briefing + the seed directive, the agent decides what to explore next. It checks the graph for gaps β topics mentioned but not explored, questions asked but not answered, contradictions to resolve.
The agent explores: reads files, searches codebases, calls APIs, or processes documents. Each piece of new information becomes a potential graph node.
Discoveries are stored as typed Cortex nodes:
factβ verified information ("The API uses JWT auth")decisionβ architectural decisions ("We chose PostgreSQL for X reason")questionβ open questions ("Why is this endpoint rate-limited?")taskβ things to do ("Need to document the webhook flow")insightβ patterns and connections ("Module A and B share a common interface pattern")
Cortex auto-links new nodes to existing ones based on embedding similarity. The agent can also create explicit edges for strong relationships. Over time, the graph becomes a rich web of interconnected knowledge.
tasty/
βββ tasty.py # Main entry point & CLI
βββ tasty.sh # Bash loop runner (Ralph-style)
βββ agent/
β βββ __init__.py
β βββ core.py # Agent core logic β the think/discover/store cycle
β βββ planner.py # Plans what to explore next based on graph gaps
β βββ discoverer.py # Explores sources and extracts knowledge
β βββ prompts.py # System prompts for the agent
βββ graph/
β βββ __init__.py
β βββ client.py # Cortex client wrapper
β βββ schema.py # Node/edge type definitions
β βββ briefing.py # Briefing generation and parsing
βββ tools/
β βββ __init__.py
β βββ file_reader.py # Read and analyze files
β βββ code_search.py # Search codebases
β βββ web_fetch.py # Fetch and parse web content
βββ config.py # Configuration management
βββ config.example.toml # Example configuration
βββ requirements.txt
βββ CLAUDE.md # Instructions for Claude Code
βββ AGENTS.md # Instructions for Amp
βββ README.md
Since Tasty uses Cortex, you get the built-in graph visualizer for free:
# Open in browser
open http://localhost:9091/vizWatch your knowledge graph grow in real-time as Tasty explores and discovers.
-
Ralph β The autonomous agent loop pattern. Ralph showed that AI agents work best when each iteration is a fresh context with persistent external memory. Tasty takes this further by replacing flat-file memory with a graph.
-
Cortex β The graph memory engine. Cortex provides the typed nodes, auto-linking, decay, and briefing synthesis that makes the graph self-organizing. Tasty is essentially a Ralph-style loop that feeds a Cortex graph.
-
Geoffrey Huntley's Ralph article β The original insight that spawned the autonomous loop pattern.
MIT