
Prev | Project Journal Entries | Github | Next
Key learnings today:
Today I learned about the Retrieval Augmented Generation (RAG) strategy. Before undertaking this learning project I had only interacted with an extremely powerful AI agent provided to me by my employer with a professional license - Augment AI. Augment seemed easy to explain complex concepts to and was able to retain all of my instructions over time. Now that I am attempting to build something fairly complex with a more lightweight model that can run on my laptop and can only have limited training data and context retention, it only seems natural to build more traditional modules into my app that can easily handle typical data retrieval tasks.
Instead of trying to train the AI to not only understand the questions it is being asked about the game, look up relevant hexadecimal values from the NES RAM and teach it to understand what all of the hex values mean at different memory addresses with many lookup tables, why not offload some of those chores to a "RAM lookup Module" in the React app? With that in mind, here is my new idea for a high level flow:

An RRM is a message in which the user is asking a question that can be answered by looking at the game RAM. An example question:
How many hit points does the Ogre have left?
Because we only need to understand where in memory the Ogre's HP is stored, and report the value back to the user (no changes), this is an RRR.
An RWR is a message in which the user is issuing a command that the bot will need to alter game memory to satisfy.
Reduce the Ogre's HP to 1.
In this case we still need to understand where in memory the Ogre's HP is stored, but we also need to write a LUA script to alter the value in memory. This is an RWR.
This is a third category of request whose definition may evolve over time. Right now my idea is that the strategy request LLM will be trained on a large dataset of Final Fantasy walkthroughs and adventure guides widely available on the internet. An example is a general question that doesn't pertain to game state such as:
How do I obtain the Mystic Key?
This is a subject well covered in the online documentation and is a simple example of an SR. Once I am successful with this, I will shoot for something even more complex - the idea of combining strategy questions with active game state. Example:
What should I do next?
This question requires combining the knowledge of the current game progress with the general information available on the internet. Not sure if I will make it this far but it's nice to think about.
Last week I was attempting to teach the LLM how to look up individual characters of the names of the party members and put them together to form the full name. This proved to be too difficult task for the lightweight Llama 3.2 3b LLM, especially since the data in NES memory is not represented as ASCII. It will be a much easier task for the FFBot App to just look up the character names itself and inject them into the training information we give the LLM. I will be looking to better organize a more comprehensive list of tasks for each module in the coming days.
Prev | Project Journal Entries | Github | Next