Inspiration
I reached a point where I could no longer add more standing rules to my AI instructions. I wanted to keep expanding them, but I was running into limits.
I had also already experienced the effects of context compaction on my rule set. Important details were being lost, instructions were drifting, and the rules I had carefully developed were no longer being followed consistently.
I realized that simply adding more rules wasn't going to solve the problem. I needed a way to store them outside the limited context window, preserve them reliably, and retrieve only what was relevant when needed.
That experience inspired me to build the Standing Rules Database.
What it does
The Standing Rules Database provides AI agents with persistent storage for standing rules and important facts, separate from their limited working context.
It uses Python and SQLite to:
- Store rules: Save standing instructions so they persist across tasks and conversations.
- Store facts: Maintain important information in a separate, searchable database.
- Retrieve relevant information: Allow agents to look up only the rules and facts needed for the current task instead of loading everything.
- Preserve rule history: Track changes to rules so previous versions aren't simply lost.
- Prevent duplicate facts: Avoid inserting the same fact repeatedly when seed data is loaded more than once.
- Track usage: Maintain a usage log to help monitor database activity.
The database can continue growing without requiring the entire collection to be loaded into an AI agent's context every time it works.
The goal is to reduce context overhead, preserve important instructions, and help AI agents remain more consistent over time.
How we built it
I built the Standing Rules Database using a combination of Hermes, Kiro, and ChatGPT.
The original idea came from my own experience with AI agent memory limitations, rule-set compaction, and instruction drift. I identified the problem and directed the design and development of a solution that would allow rules and facts to be stored persistently outside an agent's working context.
Hermes was part of my AI agent development workflow.
Kiro assisted with Python and SQLite implementation, debugging, testing, and project documentation. It also helped identify and correct implementation mistakes and verify improvements through automated tests.
ChatGPT (OpenAI) assisted throughout the development process with technical planning, explaining database concepts, reviewing code and test results, troubleshooting problems, evaluating design decisions, and helping refine the project. ChatGPT also helped me prepare the documentation and competition submission.
Development was an iterative process involving testing, reviewing, and refining the implementation. One important improvement was fixing duplicate fact insertion when seed data was loaded repeatedly, followed by creating automated regression tests to verify the fix.
Throughout development, I learned the importance of cross-checking AI-generated work rather than accepting suggestions blindly. Each tool contributed differently, but I remained responsible for the project's direction, design decisions, and final results.
Challenges we ran into
One of the biggest challenges was that no single AI tool got everything right.
Hermes made mistakes that Kiro and ChatGPT helped identify and correct. However, the feedback loop went both ways: Hermes also caught an issue with an approach proposed by Kiro.
ChatGPT helped review code, question assumptions, examine test results, and identify potential problems. Kiro helped implement and verify corrections, while Hermes provided another perspective that sometimes exposed issues the others had missed.
This created a continuous cycle of proposing, reviewing, challenging, correcting, and testing. Rather than relying on one AI tool to provide all the answers, I used the different tools to cross-check each other's work.
We also encountered practical development challenges, including preventing duplicate facts when seed data was loaded repeatedly. That required a code fix and regression tests to verify the solution.
The biggest lesson was that AI tools can make mistakes, even when their answers sound convincing. Having multiple tools challenge each other's suggestions, combined with testing and human oversight, made the development process stronger.
It was a big feedback loop, and that became one of the most valuable parts of building this project.
Accomplishments that we're proud of
I'm proud that I took a problem I was experiencing firsthand with AI agent memory and turned it into a working solution.
Some of the accomplishments I'm most proud of include:
- Breaking through context limitations: Creating a system that allows standing rules and facts to grow beyond the limits of an agent's working context.
- Persistent storage: Building a Python and SQLite database that keeps important rules and facts available across tasks.
- Selective retrieval: Separating long-term storage from context usage so agents can retrieve only the information relevant to their current work.
- Rule history: Supporting the preservation of previous rule versions rather than simply overwriting them.
- Reliability: Identifying and fixing duplicate fact insertion during repeated seeding, then verifying the fix with five passing automated tests.
- AI collaboration: Successfully using Hermes, Kiro, and ChatGPT in a continuous feedback loop where each tool contributed ideas, identified problems, and helped improve the result.
- Open-source contribution: Publishing the project on GitHub under the MIT License so others can explore, use, and build upon it.
Perhaps my biggest accomplishment is that I didn't just accept the limitations I was running into. I recognized a problem, developed an idea to address it, and kept working through the challenges until I had a functioning project.
What we learned
One of the biggest lessons we learned is that an AI agent's context is a limited resource, and important information shouldn't depend entirely on what the agent can keep in its working memory. Storing standing rules and facts externally, then retrieving only what is relevant, offers a more sustainable approach.
We also learned that persistent storage is only part of the solution. The information must be organized, easy to retrieve, and maintained reliably. Even a seemingly small issue, such as duplicate facts being inserted during repeated seeding, can affect the quality of the data. Automated tests are essential for catching these problems and preventing them from returning.
Another important lesson came from using Hermes, Kiro, and ChatGPT together. No single tool was always right. Each could make mistakes or overlook something, but having them review and challenge one another helped uncover problems that might otherwise have been missed.
Most importantly, we learned not to accept AI-generated code or recommendations blindly. Human judgment, careful review, and repeatable testing remain essential. AI tools can accelerate development, but responsibility for evaluating the results still belongs to the developer.
This project reinforced the value of building practical solutions to real problems, iterating when things don't work as expected, and treating reliability as an essential part of software development.
What's next for standing-rules-database-skill
The next step is to continue developing the Standing Rules Database into a more complete and reliable persistent memory system for AI agents.
Some areas I'd like to explore include:
- Broader agent integration: Make it easier to connect the database to different AI agents and workflows, beyond the environment in which it was initially developed.
- Smarter retrieval: Improve how agents identify and retrieve the rules and facts most relevant to the task at hand.
- Improved rule management: Expand the ability to organize, update, prioritize, and maintain standing rules over time.
- Stronger reliability: Continue expanding automated tests and improving safeguards for data integrity, consistency, and recovery.
- Better documentation and examples: Make installation, configuration, and integration easier for other developers.
- Community feedback: Share the project with other AI developers, learn how they manage persistent instructions and memory, and use their feedback to guide future improvements.
My longer-term goal is to make it easier for AI agents to maintain continuity across tasks without having to carry their entire history or rule set in every context window.
This project started as a solution to a problem I experienced firsthand. I'd like to keep improving it so that other developers facing similar context and memory limitations can benefit from it too.