Persistent Cortex storage with Sled backend and Ineru snapshots#60
Merged
ApiliumDevTeam merged 2 commits intomainfrom Mar 9, 2026
Merged
Persistent Cortex storage with Sled backend and Ineru snapshots#60ApiliumDevTeam merged 2 commits intomainfrom
ApiliumDevTeam merged 2 commits intomainfrom
Conversation
Switch Cortex from volatile in-memory GraphDB to Sled-backed persistent storage by default (~/.aingle/cortex/graph.sled). Add --db and --memory CLI flags, /api/v1/flush endpoint, Ineru memory snapshot export/import, and graceful shutdown with automatic data flush. - Add db_path to CortexConfig with :memory: escape hatch - Add AppState::with_db_path() for Sled or memory initialization - Add AppState::flush() for graph + Ineru snapshot persistence - Add GraphDB::flush() and GraphStore::flush() delegating to backend - Add IneruMemory export/import/save/load snapshot methods - Add POST /api/v1/flush REST endpoint - Enable sled-backend feature in aingle_cortex by default - Graceful shutdown flushes graph + saves Ineru snapshot on SIGINT - Bump all crate versions 0.4.0 → 0.4.1
Use tokio::select! to listen for both SIGINT (ctrl_c) and SIGTERM, ensuring Cortex flushes graph data and saves Ineru snapshots when the sidecar manager sends SIGTERM during binary updates.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.aingle/cortex/graph.sled), with--memoryflag for volatile mode--db <PATH>CLI flag to customize storage location/api/flushendpoint and automatic flush on SIGTERM/SIGINTtokio::select!Test plan
cargo build --workspace && cargo test --workspaceaingle-cortex --memory→ volatile mode, data lost on restartcurl -X POST localhost:2520/api/flush→ 200 OK