A flexible Goal-Oriented Action Planning (GOAP) system for game AI and planning problems, featuring A* search, efficient state management, and modular design.
Project description
GOAP Planner (goapauto)
Goal-Oriented Action Planning for Python — Build intelligent, autonomous agents with strict typing and comprehensive tooling.
goapauto provides a modular framework for AI decision-making using A* search. It separates Perception (Sensors), Thinking (Arbitration), Planning (A*), and Acting (Actions), making it ideal for game AI, NPCs, and simulation bots.
🚀 Key Features (v0.2.0)
- 🎯 Goal Arbitration: Dynamically select the best goal based on priority and state.
- 🧠 Smart Planning: A* pathfinding finds the optimal sequence of actions.
- 🛡️ Type Safety: Built on Pydantic for strict validation and robustness.
- 👁️ Visualizer: Export search trees to Mermaid or Graphviz for debugging.
- 🔌 Modular Architecture: Decoupled components for
WorldState,Sensors, andGoals.
📚 Documentation
Detailed documentation is available in the docs/ directory:
- 🏁 Getting Started: Build your first agent in minutes.
- 📖 Core Concepts: Understand the Sense-Think-Plan-Act loop.
- ⚙️ API Reference: Deep dive into classes (
WorldState,Planner, etc.).
📦 Installation
uv add goapauto
# or
uv add goapauto
⚡ Quick Start
Here's a minimal example of an agent figuring out how to open a door.
from goapauto.models.worldstate import WorldState
from goapauto.models.goal import Goal
from goapauto.models.actions import Action
from goapauto.models.goap_planner import Planner
# 1. The World: Agent has a key, but the door is closed.
state = WorldState(has_key=True, is_open=False)
# 2. The Action: Needs 'has_key' to open the door.
open_door = Action(
name="open_door",
preconditions={"has_key": True, "is_open": False},
effects={"is_open": True},
cost=1.0
)
# 3. The Goal: We want the door open.
goal = Goal(target_state={"is_open": True})
# 4. The Plan: Find the path.
planner = Planner(actions_list=[open_door])
result = planner.generate_plan(state, goal)
print(f"Plan to '{goal.name}': {result.plan}")
# Output: Plan to "{'is_open': True}": ['open_door']
🛠️ Advanced Tooling
Visualization
Debug your planner's decision-making process by exporting the search tree:
from goapauto.utils.visualizer import SearchTreeVisualizer
viz = SearchTreeVisualizer()
planner.register_hook("on_node_expanded", viz.on_node_expanded)
# ... run plan ...
# Save as a Mermaid diagram
viz.export("planning_tree.mmd")
🤝 Contributing
Contributions are welcome! Please read CONTRIBUTING.md and our Code of Conduct.
📄 License
MIT License. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goapauto-0.2.1.tar.gz.
File metadata
- Download URL: goapauto-0.2.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd91c7c0dc63c6c292ae1dd39f981eea21b7ae187f74bbc4840eaa1a8fe80ba5
|
|
| MD5 |
813aca6400e67dc1ad4c699a1b1fa392
|
|
| BLAKE2b-256 |
bbdd81add171da2cea3c81a480f677deda5a6b156d52715b6e3cb4eb4ed2729a
|
Provenance
The following attestation bundles were made for goapauto-0.2.1.tar.gz:
Publisher:
release.yml on IAmNo1Special/goapauto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goapauto-0.2.1.tar.gz -
Subject digest:
bd91c7c0dc63c6c292ae1dd39f981eea21b7ae187f74bbc4840eaa1a8fe80ba5 - Sigstore transparency entry: 854868974
- Sigstore integration time:
-
Permalink:
IAmNo1Special/goapauto@d61dfc2c357fd5f817520b54299d36a6629617df -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/IAmNo1Special
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d61dfc2c357fd5f817520b54299d36a6629617df -
Trigger Event:
push
-
Statement type:
File details
Details for the file goapauto-0.2.1-py3-none-any.whl.
File metadata
- Download URL: goapauto-0.2.1-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278e0e7f41c099eabb28ae8c545f6320dded901bee474f6b4275f6af58f1b2f0
|
|
| MD5 |
a9fe0dea50fc4ab971810d0c32f99288
|
|
| BLAKE2b-256 |
e1074f6ec901ae3b9b2defe475abc45466b161033cfe11e9022da6c3c8aab074
|
Provenance
The following attestation bundles were made for goapauto-0.2.1-py3-none-any.whl:
Publisher:
release.yml on IAmNo1Special/goapauto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goapauto-0.2.1-py3-none-any.whl -
Subject digest:
278e0e7f41c099eabb28ae8c545f6320dded901bee474f6b4275f6af58f1b2f0 - Sigstore transparency entry: 854868976
- Sigstore integration time:
-
Permalink:
IAmNo1Special/goapauto@d61dfc2c357fd5f817520b54299d36a6629617df -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/IAmNo1Special
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d61dfc2c357fd5f817520b54299d36a6629617df -
Trigger Event:
push
-
Statement type: