Skip to content

Atmsamma/tasty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ• Tasty

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.

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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

Quick Start

Prerequisites

  • Python 3.10+
  • Cortex installed and running
  • An LLM API key (OpenAI, Anthropic, or local)

Install

git clone https://github.com/robot-rubik/tasty.git
cd tasty
pip install -r requirements.txt

Configure

cp config.example.toml config.toml
# Edit config.toml with your settings

Run

# 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"

Configuration

[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.75

How the Agent Thinks

Each iteration follows this cycle:

1. Briefing Phase

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.

2. Planning Phase

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.

3. Discovery Phase

The agent explores: reads files, searches codebases, calls APIs, or processes documents. Each piece of new information becomes a potential graph node.

4. Storage Phase

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")

5. Linking Phase

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.

Architecture

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

Graph Visualization

Since Tasty uses Cortex, you get the built-in graph visualizer for free:

# Open in browser
open http://localhost:9091/viz

Watch your knowledge graph grow in real-time as Tasty explores and discovers.

Inspiration & References

  • 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.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors