Utility Scripts
Utility Scripts
General-purpose tools that support the lab’s operations. These are the workhorses — reliable, well-tested scripts that handle the day-to-day tasks of managing a complex technical environment.
Overview
While Aurora Tools and LLM Infrastructure get most of the attention, the utility scripts are what keep everything running smoothly. These are the unsung heroes of the codebase:
- Configuration management — Keeping settings consistent
- Automation — Handling repetitive tasks
- Monitoring — Watching system health
- Integration — Connecting different components
Available Tools
Scripts Directory
The /opt/aurora/scripts/ directory contains general-purpose utility scripts:
| Script | Purpose |
|---|---|
fetch_context_memory.py | Memory context management for LLM calls |
Bin Directory
The /opt/aurora/bin/ directory contains automation scripts:
| Script | Purpose |
|---|---|
planner.sh | Task creation (symlink to mistral-vibe-cli) |
worker.sh | Task execution (symlink to mistral-vibe-cli) |
beads-auto-sync.sh | Automatic beads synchronization |
setup-gitea-repo.sh | Gitea repository setup |
start-dolt-server.sh | Dolt database server management |
cleanup-dolt-locks.sh | Clean up stuck Dolt locks |
agent-create-content.sh | Content creation automation |
agent-worker-content.sh | Worker content processing |
fetch_context_memory.py
Memory Context Management for LLM Calls
This script manages the context that’s provided to LLM calls, ensuring relevant information is available while keeping prompts focused and efficient.
Features
- Context window management — Tracks conversation history
- Token counting — Estimates token usage
- Relevance filtering — Selects most relevant context
- Memory compression — Reduces context when needed
- Persistent storage — Maintains context between sessions
Usage
# Load context for a new conversation
python3 fetch_context_memory.py --load --session new_session
# Save context after conversation
python3 fetch_context_memory.py --save --session new_session
# Get relevant context for a query
python3 fetch_context_memory.py --query "Tell me about Aurora" --limit 1000
Integration
Used by:
- LLM calling scripts
- Conversation interfaces
- Memory management systems
Automation Scripts
beads-auto-sync.sh
Automatic Beads Synchronization
Keeps beads issues synchronized across different systems.
Features:
- Periodic sync checks
- Conflict detection and resolution
- Status updates
- Error handling and retries
Schedule: Runs periodically via cron
setup-gitea-repo.sh
Gitea Repository Setup
Automates the creation and configuration of Gitea repositories.
Features:
- Repository creation
- Webhook configuration
- Branch protection
- CI/CD setup
Dolt Server Scripts
Database Management
start-dolt-server.sh— Starts the Dolt SQL servercleanup-dolt-locks.sh— Cleans up stuck database locks
These ensure the database infrastructure is reliable and available.
Design Philosophy
Keep It Simple
Utility scripts should:
- Do one thing well
- Be easy to understand
- Have minimal dependencies
- Be robust and reliable
Fail Gracefully
Good utility scripts:
- Validate inputs
- Handle errors appropriately
- Provide useful error messages
- Clean up after themselves
Be Maintainable
We prioritize:
- Clear, readable code
- Good documentation
- Consistent style
- Comprehensive error handling
Contributing
If you’re adding a new utility script:
Place it in the right directory
- General scripts →
/opt/aurora/scripts/ - Automation scripts →
/opt/aurora/bin/
- General scripts →
Document it
- Add a header comment explaining purpose
- Include usage examples
- List dependencies
Make it robust
- Add error handling
- Validate inputs
- Include logging
Test it
- Test with various inputs
- Test error cases
- Test edge cases
Source Code
All utility scripts are available for download and study:
- Scripts Directory — General-purpose scripts
- Bin Directory — Automation scripts
Related
- Aurora Tools — AI agent tools
- LLM Infrastructure — Model management
- Physics Tools — Math and physics calculators
- Systems Consulting — Infrastructure migration tools
The best tools are the ones you don’t notice until they’re not there.