How trueagi-io/petta works
PeTTa is a MeTTa language implementation in Prolog. Its user-facing workflow is to run MeTTa code through the SWI-Prolog entry point, or submit files and strings through the Python API, which consults the runtime and invokes helper predicates. The tree also identifies parsing, translation, spaces, specialization, and extension modules, plus optional MORK/FAISS support and extension libraries. Internal Prolog call relationships are not shown in the supplied excerpts, so those connections are omitted; optional space integrations are documented in the README.
Main entry points: __init__.py Python API · main.pl Runtime Entry · spaces.pl Atom Spaces · helper.pl Python Helpers
Components 16
Prolog Runtime
- Runtime Entry
src/main.pl - Parser
src/parser.pl - Translator
src/translator.pl - Atom Spaces
src/spaces.pl - Specializer
src/specializer.pl - File Reader
src/filereader.pl - Extension Points
src/ext_points.pl
Python Interfaces
- Python API
python/petta/__init__.py - Python CLI
python/petta/cli.py - Python Helpers
python/helper.pl
Extensions
- MORK Spaces
- FAISS Vectors
- Git Imports
lib/lib_import.metta - LLM Integration
lib/lib_llm.py
Other components
- MeTTa User
- OpenRouter
Connections 8
- MeTTa User → Runtime Entry: runs code
README.md - Python CLI → Runtime Entry: starts entry
python/petta/cli.py - Python API → Runtime Entry: consults runtime
python/petta/__init__.py - Python API → Python Helpers: consults helper
python/petta/__init__.py - Python API → Python Helpers: queries helpers
python/petta/__init__.py - Atom Spaces → MORK Spaces: optional spaces
README.md - Atom Spaces → FAISS Vectors: optional vectors
README.md - LLM Integration → OpenRouter: sends requests
lib/lib_llm.py