diff --git a/gdx-ai/src/com/badlogic/gdx/ai/btree/utils/BehaviorTreeLibrary.java b/gdx-ai/src/com/badlogic/gdx/ai/btree/utils/BehaviorTreeLibrary.java
index <HASH>..<HASH> 100644
--- a/gdx-ai/src/com/badlogic/gdx/ai/btree/utils/BehaviorTreeLibrary.java
+++ b/gdx-ai/src/com/badlogic/gdx/ai/btree/utils/BehaviorTreeLibrary.java
@@ -128,5 +128,19 @@ public class BehaviorTreeLibrary {
 		}
 		return archetypeTree;
 	}
+	
+	/** Registers the {@link BehaviorTree} archetypeTree with the specified reference. Existing archetypes in the repository
+	 * with the same treeReference will be replaced.
+	 * @param treeReference the tree identifier, typically a path.
+	 * @param archetypeTree the archetype tree.
+	 * @throws IllegalArgumentException if the archetypeTree is null
+	 */
+	protected void registerArchetypeTree(String treeReference, BehaviorTree<?> archetypeTree){
+	    if(archetypeTree == null){
+		throw new IllegalArgumentException("The registered archetype must not be null.");
+	    }
+	    
+	    repository.put(treeReference, archetypeTree);
+	}
 
 }
Added a method "registerArchetypeTree" to the class BehaviorTreeLibrary
to have the possibility to add archetype behavior trees programatically
instead of loading from files, as suggested in the comments at
<URL>