I built a Python chat assistant with no neural network. Can it keep track of a key?
Maya picks up a key in the kitchen. She hands it to Leo, and Leo walks into the garden. Where’s the key now?
CAEL answers garden. If I ask who received it, it says Leo. If I ask why Maya handed it over, the story module returns None. I kept that last question in the demo because it shows where this approach stops working.
Watch the 30-second demo (https://github.com/Vovala14/CAEL/releases/download/v0.4.5/CAEL-045-Follow-the-Key.mp4)
I’ve been building CAEL as a local chat and reasoning assistant in Python. There’s no neural network in the reply path. The full assistant uses rules, exact solvers, search and text retrieval. For this example, all it needs is a small Python module and a few pieces of state.
What changes when Leo moves?
The story reader keeps track of who is where, who’s carrying what, and what happened earlier. Giving Leo the key changes its holder. When Leo moves, the key’s location changes with him. To answer the question, the module looks up the resulting state.
Here’s the prompt from the demo. You can run just the story reader from a checkout of v0.4.5 (https://github.com/Vovala14/CAEL/releases/tag/v0.4.5), without downloading the full chat bundle:
`from cael_unified.world_model import reply
story = (
"Maya went to the kitchen. Maya picked up the key. "
"Leo went to the kitchen. Maya gave the key to Leo. "
"Leo went to the garden."
)
result = reply(story + " Where is the key?")
print(result["response"]) # garden`
The downside is that wording matters. The story reader answers only when it can parse every statement and handle the question. When it can’t, it returns None, and the full assistant can try another route. That makes the story module easier to debug, but it also means a simple rephrasing can be enough to trip it up.
If you want to poke at it, try rewriting the story without changing what happened. What’s the simplest version that makes it lose track of the key? That’s the kind of example I’d like to see.
Release and setup instructions (https://github.com/Vovala14/CAEL/releases/tag/v0.4.5) · Story reader source (https://github.com/Vovala14/CAEL/blob/v0.4.5/cael_unified/world_model.py)
