llmangosavestate

package
v0.0.0-...-9409c51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2025 License: Unlicense Imports: 5 Imported by: 0

README

LLMango Save State

Persistent state management for goals, prompts, and execution history with JSON-based storage.

Features

JSON Storage ✅

Simple, human-readable persistence layer:

type SaveState struct {
    Goals   map[string]*Goal   `json:"goals"`
    Prompts map[string]*Prompt `json:"prompts"`
    History []ExecutionRecord  `json:"history"`
}
Atomic Operations ✅

Thread-safe state management with atomic file operations:

  • Concurrent read/write protection
  • Atomic file updates to prevent corruption
  • Automatic backup and recovery
State Synchronization ✅

Seamless integration with LLMango core for persistent state:

// Auto-save on changes
manager.Goals.Add(goal)        // Automatically persisted
manager.Prompts.Update(prompt) // Automatically persisted

// Manual save/load
saveState.Save("state.json")
saveState.Load("state.json")

Key Components

Usage

// Initialize with file-based persistence
saveState := llmangosavestate.NewJSONSaveState("llmango_state.json")

// Integrate with LLMango manager
manager := llmango.NewLLMangoManager(openRouter, saveState)

// State is automatically persisted on changes
manager.Goals.Add(newGoal)     // Auto-saved
manager.Prompts.Add(newPrompt) // Auto-saved

Status: ✅ Complete

Reliable state persistence with JSON storage, atomic operations, and seamless LLMango integration.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithJSONSaveState

func WithJSONSaveState(fileName string, llmangoManager *llmango.LLMangoManager) (*llmango.LLMangoManager, error)

WithJSONSaveState configures the LLMangoManager to use a JSON file for saving and loading state.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL