Integrates GPT prompting into the Sabre Narrative Planner for research and experimentation involving LLM-guided search methodologies for planning-based story generation.
Assign action costs based on what GPT says should happen next in the story.
To run, you must have a valid OpenAI API key stored in an environment variable called OPENAI_KEY.
Requires Java. Uses Sabre v0.7.
Run Sabre with -m llm for the LLM-UCS search method. To run the example problem:
java -jar lib/sabre.jar -p problems/gramma.txt -atl 5 -ctl 4 -el 1 -g 1 -m llm
This searches the gramma problem with LLM-UCS, limited to 5 nodes by default. (Configurations in LLMSearch.java)
Writes two output files:
out/search.txtlists each node in the order visitedout/transcript.txtshows the full conversation with GPT and resulting action costs at each step.
Large Language Models as Narrative Planning Search Guides
R. Farrell and S. G. Ware, "Large Language Models as Narrative Planning Search Guides," in IEEE Transactions on Games, vol. 17, no. 2, pp. 419-428, June 2025, doi: 10.1109/TG.2024.3487416.
Search results for the Sabre benchmark problems are discussed in the paper, and complete transcripts from these searches are included here.
