An agentic AI system implemented in MeTTa, guided by the MeTTaClaw proposal and an agent core inspired by Nanobot. Beyond basic tool use, it features embedding-based long-term memory represented entirely in MeTTa AtomSpace format.
Long-term memory is deliberately maintained by the agent via (remember string) for adding memory items and (query string) for querying related memories.
The agent can learn and apply new skills and declarative knowledge through the use of memory items.
In addition, an initial set of OpenClaw-like tools is implemented, including web search, file modification, communication channels, and access to the operating system shell and its associated tools.
Simplicity of design, ease of prototyping, ease of extension, and transparent implementation in MeTTa were the primary design criteria. The agent core comprises approximately 200 lines of code.
Special Features
-
MeTTaClaw uses a token-efficient agentic loop, enabling low-cost long-term operation and embodiment in domains that require real-time learning and decision-making.
-
The agent can learn to represent its memories in different ways, including such that allow other Hyperon components to operate on the same memories within the same Atomspace. Each memory item is stored as a triplet
(timestamp, atom, embedding), while the agent remains flexible in choosing the representation for the atom itself. Consequently, the agent is not hardcoded to any particular memory representation, and different formats can co-exist in the same atom space.
The following example demonstrates learning and decision-making in a textually represented grid-world environment adapted from NACE:
This project also aims to explore the potential of Agentic Physical AI, a ROS2 package for mobile robots with manipulators is underway.
Installation
First, get SWI-Prolog. Then:
git clone https://github.com/trueagi-io/PeTTa
cd PeTTa
mkdir -p repos && git clone https://github.com/patham9/mettaclaw repos/mettaclaw
Usage
Run the system via the following command which ensures the system is started from the root folder of PeTTa:
cp repos/mettaclaw/run.metta ./
OPENAI_API_KEY=... sh run.sh run.metta
Auto-install/run
Alternatively, if PeTTa is already installed and the latest version pulled (v1.0.2 or latest commit), then, running the following MeTTa file from the root folder, installs and runs MeTTaClaw (assuming OPENAI_API_KEY is set):
!(import! &self (library lib_import))
!(git-import! "https://github.com/patham9/mettaclaw.git")
!(import! &self (library mettaclaw lib_mettaclaw))
!(mettaclaw)
Illustrations
Long-Term Memory Recall:
Tool use:
Shell output of the actual invocation of the generated MeTTa code:
System also added it into its Atom Space storage (embedding vector omitted):
