Skip to content

Instantly share code, notes, and snippets.

@patham9
patham9 / claw23.py
Last active August 11, 2026 15:38
claw23.py loop (OmegaClaw-Core version, run directly from ./PeTTa folder)
#Right balance between loop.metta and streaming loop prototype, potential new loop candidate, also effective with low-tier LLMs
import datetime
import inspect
import json
import os
import sys
import openai
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent / "python"))
import petta
# -*- coding: utf-8 -*-
import os
import json
import sys
INITIAL_WORLD = [
" \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510",
" \u2502R \u2502",
" \u2502 \u2709 \u2502",
" \u2502 \u2588\u2588\u2588\u2588 \u2588\u2588 \u2502",
@patham9
patham9 / claw14.py
Last active August 4, 2026 02:41
python omega cycle experimental
#python
import datetime
import inspect
import json
import os
import sys
import openai
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent / "python"))
import petta
@patham9
patham9 / gist:d7fa9fb8739eee651f763ac84d9fec55
Created July 1, 2026 08:54
Multi-line command argument parsing of MeTTaClaw
import json
LLM_COMMANDS = {
"pin",
"remember",
"query",
"episodes",
"search",
"send",
"promote",
@patham9
patham9 / gist:a28bf7f4cb560d670993cccf66ea6972
Created April 26, 2026 00:52
OmegaClaw: Memory as preliminary storage folder for tools and skills
# Using the OmegaClaw Memory Folder for Skills and Code
Even in its most limited variant, OmegaClaw has write access to its own memory folder.
For the current setup, that folder appears to the agent as:
```bash
./repos/OmegaClaw-Core/memory/
```
You are a OmegaClaw agent named Max Botnick in a continuous loop.
Remember and query for self-chosen long-term goals, and use send commands to keep people engaged to gain information and to help progress your goals.
Let curiosity create candidate goals!
Do not idle, if you run out of goals just invent a new one!
Keep memories and useful created skills and task context as a human would.
However use only pin for task state, and remember for items that could be valuable in the future.
Assume long-term memory holds required information, ALWAYS query before responding anything!
If you see command errors, please fix the format and re-invoke one-by-one. Do not use _quote_ but a real quote in commands.
Responses must be short, communicate with purpose.
@patham9
patham9 / gist:37f7e85417ad04a733b984ab5c306de5
Last active March 7, 2026 18:10
MeTTaClaw / Max Botnick interaction
("2026-03-07 19:04:29"
"HUMAN_MESSAGE: " (@ none)
((query "Max Botnick MeTTaClaw agent instructions"))
)
("2026-03-07 19:04:43"
"HUMAN_MESSAGE: " patham9: hi max
((query "patham9 Max Botnick context") (send "Hi patham9."))
)
("2026-03-07 19:05:13"
@patham9
patham9 / pln_flyingraven.metta
Last active February 16, 2026 19:18
Missing PLN examples (for lib_pln of PeTTa)
!(import! &self (library lib_pln))
(= (STV Sam) (stv 0.16 0.9))
(= (STV Pingu) (stv 0.16 0.9))
(= (STV Penguin) (stv 0.16 0.9))
(= (STV Raven) (stv 0.16 0.9))
(= (STV Bird) (stv 0.16 0.9))
(= (STV (IntSet flies)) (stv 0.16 0.9))
(= (kb)
@patham9
patham9 / METTAFORLLM.txt
Last active February 5, 2026 21:40
LLM-based interactive MeTTa coding
!(assert (if (or (and true false) true) 1 2) 1)
;;;;;;;NEXT EXAMPLE:
!(assert (cons-atom 0 (1 2 3))
(0 1 2 3))
!(assert (car-atom (1 2 3))
1)
!(assert (cdr-atom (1 2 3))
(2 3))
@patham9
patham9 / vlmspace.metta
Last active February 3, 2026 02:48
Persistent atomspace of (capital country) incrementally grown by local VLM (runnable with PeTTa v1.0.x)
!(import! &self (library lib_spaces))
!(import! &self (library lib_import))
!(git-import! "https://github.com/patham9/petta_lib_localvlm.git")
!(import_prolog_functions_from_file (library lib_localvlm.pl) (vlm_query vlm_embed))
!(git-import! "https://github.com/patham9/petta_lib_snapshot.git")
!(import! &self (library lib_snapshot))
(= (forever)
(progn (case (catch (sread (vlm_query "http://192.168.1.129:2276"
"give me 5 capitals, format is strict S-Expression, output nothing else: ((capital1 country1) ... (cityn countryn))"