Skip to content

feat: add SQLite persistent storage for benchmark results (#26)#34

Open
Sugaria0427 wants to merge 1 commit into
Neal006:mainfrom
Sugaria0427:feat/sqlite-persistent-storage
Open

feat: add SQLite persistent storage for benchmark results (#26)#34
Sugaria0427 wants to merge 1 commit into
Neal006:mainfrom
Sugaria0427:feat/sqlite-persistent-storage

Conversation

@Sugaria0427
Copy link
Copy Markdown

Summary

Replace flat JSON/CSV log storage with a queryable SQLite database for benchmark results, while maintaining full backward compatibility.

Related issue

Closes #26

Type of change

  • API or infrastructure

How was this tested?

python tests/test_pipeline.py  (29/29 pass)
python main.py --turns 10 --checkpoints 5 10 --backends naive --log
python utils/migrate_legacy_logs.py

Checklist

  • All existing tests pass
  • New tests added (6 new tests)
  • Docstrings added on all new public classes and functions
  • Type hints used on all new function signatures
  • No API key required to run any new tests
  • Backward compatible — JSON/CSV output unchanged

Replaces flat JSON/CSV log storage with a queryable SQLite database
while maintaining full backward compatibility.

New files:
- utils/storage.py — Storage class wrapping Python stdlib sqlite3.
  Schema: runs (run_id, timestamp, config_json) + results (run_id FK,
  backend, turn, metric, value). API: save_run, get_run, list_runs,
  compare_runs.
- utils/migrate_legacy_logs.py — one-shot idempotent migration script
  that imports existing experiment_logs/*.json into SQLite.

Modified files:
- evaluation/logger.py — log_run() now calls Storage().save_run()
  alongside existing JSON+CSV writes. list_runs() queries SQLite
  first, falls back to filesystem scan. Fixes pre-existing
  has_llm_eval bug in _append_csv_summary.
- tests/test_pipeline.py — 6 new tests (4 Storage CRUD + 2 logger
  integration).
- CHANGELOG.md — documented the new feature.
- .gitignore — added experiment_logs/memorylens.db.

Closes Neal006#26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: SQLite persistent storage — replace flat JSON logs with a queryable database

1 participant