Conversation
Closes #17 Before this change, wagl hard-coded the build-tree path 'third_party/sqlite-vec/linux-x86_64/vec0.so' for loading the sqlite-vec extension, which always failed for standalone binary installs. Now resolve_vec_path() searches in priority order: 1. SQLITE_VEC_PATH env var (explicit override — always wins) 2. Next to the wagl binary (<exe-dir>/vec0.so) 3. System lib: /usr/local/lib/vec0.so 4. User lib: ~/.wagl/lib/vec0.so 5. Build-tree fallback (dev environments only) For standalone installs, copying vec0.so next to the binary or to /usr/local/lib/ is now sufficient — no env var required. Also: - Update docs/sqlite-vec.md to document the search order and install guide - Add README acknowledgement for sqlite-vec (MIT, by Alex Garcia) - Add README section on optional vector embeddings setup
Replace runtime .so loading with compile-time static linking via the sqlite-vec crate (MIT/Apache-2.0). sqlite3_auto_extension() registers sqlite3_vec_init on every new libsql connection automatically. Users no longer need to build or ship vec0.so. Configure WAGL_EMBEDDINGS_BASE_URL and WAGL_EMBEDDINGS_MODEL and wagl handles the rest. Closes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
P1 — move register_sqlite_vec() before db.connect() sqlite3_auto_extension only applies to connections opened *after* registration. The previous order (register after connect) meant the first connection never got vec0 initialized, causing probe_vec to fail. P2 — replace Once + mutable result with OnceLock<Result<(), String>> The Once pattern silently returned Ok(()) on subsequent calls even when the initial sqlite3_auto_extension failed (the closure doesn't re-run, so the local result variable was never set to Err). OnceLock stores and replays the actual outcome of the one-time registration. docs — correct 'not exercised' to 'not registered' When embeddings are not configured, register_sqlite_vec() is never called at all (guarded by embeddings_configured()). The doc previously implied it was registered but idle.
…n estimation, canon hygiene
4.1: Composite scoring in recall — weighted formula: semantic×0.5 + salience×0.2 + recency×0.15 + EV×0.15.
Falls back gracefully to text query when embeddings/vec0 unavailable.
4.2: Enhanced why_included annotations with match reason, salience, type, relative date, composite score.
4.3: Token estimation (meta.token_estimate) in recall output.
4.4: Canon duplicate detection — canon list now includes warnings for duplicate canon tags.
4.5: Canon name validation — enforces [a-z][a-z0-9._-]* naming convention on get/set.
…ways, connections
5.1: memory_edges table (source_id, target_id, relation, weight, created_at).
5.2: wagl link command — create edges between memory items.
Validates both items exist and relation is valid (derived_from, related_to, depends_on, supersedes).
5.3: wagl neighbors command — list connected memories (1-hop) with direction, relation, weight.
5.4: --derived-from on put — auto-creates a derived_from (pathway) edge.
5.5: --connection on put — auto-creates related_to (connection) edges (repeatable).
5.6: Multi-hop traversal — wagl neighbors --depth N with BFS.
DB methods: put_edge, edges_from, edges_to, neighbors, delete_edge.
6.1: wagl stats — rich statistics: counts by type, avg salience, embedding coverage %,
oldest/newest items, top N tags, edge count, expertise breakdown, recollection level.
6.2: wagl gc — garbage collection with dry-run by default. Prunes items below salience
threshold + older than N days. Protects canon items. Cleans up embeddings + edges.
DB: added delete(), count_by_type(), avg_salience(), date_range(), top_tags(), edge_count().
…command
7.1: Support posture — sleep now emits a time-bounded support posture with signals
(stress detection, positive momentum, commitment overload). Valid for 24h.
7.4: wagl morning — loads canon items + active commitments (7d window) + recent context
(1d) + token estimate. Replaces 'human re-teaches every session' pattern.
…on update proposals
6.3: Reconcile improvements — detect items with no tags, orphaned edges, stale canon items (>30d).
6.4: wagl decay — salience decay with configurable half-life and floor. Dry-run by default.
DB: added update_salience(), conn_ref().
7.2: Canon update proposals in sleep — existing canon items get update suggestions
when recent stream items overlap topically. Shows current text + relevant items.
5.5.1: People memory type — type 'people' with trust_level (-5 to 5, default 0).
5.5.2: Trust adjustment workflow — wagl trust adjust with reason logging as observations.
Adjustments are linked to person via memory_edges.
5.5.3: Link people to memories — person:<name> tagging; trust get shows linked observations.
5.5.4: Observation surfacing — observations tagged with person names surface in trust get.
DB: added update_item() for in-place updates.
Reconcile now flags items tagged type:hypothesis + expires:<date> when the expiration date has passed. Suggests review/update/delete/extend actions.
…construction (5.7) - New IntentItem type for term/alias mapping (canonical_term -> alias, per org/person) - DB table 'intents' with CRUD methods + search - CLI: wagl intent add/list/search/delete subcommands - CLI: wagl reconstruct <id> follows derived_from edges and reassembles document - Status output now includes intent_count - DB helper methods: intent_aliases_for, intent_canonicals_for (for 6.5.3)
Recall now searches intent aliases to expand query terms. If task text matches an intent alias or canonical term, related aliases are also searched, merging additional results into the recall pack. Expanded terms are included in meta output.
- wagl ingest transcripts: reads OpenClaw session JSONL files - Redaction pipeline: scrubs bearer tokens, API keys, JWTs, URL creds, SSH keys - Size policy: truncates turns above configurable threshold (default 2000 chars) - Dedupe via sessionId+turnIndex key (idempotent) - Recollection-governed: respects RECOLLECTION level - Supports --dry-run, --days, --limit, --size-threshold
- New wagl-server crate: axum-based HTTP API wrapping DB layer
- Endpoints: GET/POST /items, GET /items/:id, DELETE /items/:id
- Endpoints: GET /intents, POST /intents, DELETE /intents/:id
- GET /status, GET /health
- CORS permissive, JSON envelope {ok, data}
- wagl serve --bind (default 127.0.0.1:3773)
- MemoryHint: 51-byte compact hint (UUID+score+type+32-byte vector)
- Encode/decode to bytes, JSON serialization, type_code mapping
- Server now holds broadcast channel; put/delete emit MemoryEvents - GET /ws WebSocket endpoint: agents receive live memory updates - Handles ping/pong, graceful disconnect, lag notifications - Phase 9.4: agent namespace via 'agent:<id>' tags - CLI wagl put --agent <id> injects namespace tag - CLI wagl query --agent <id> filters to agent namespace - HTTP API: PUT /items accepts agent_id, GET /items?agent_id= filters
- ingest: track turns_deduped separately from turns_imported Previously, re-running the same sessions would count all turns as 'imported' again. Now deduped turns are counted separately and genuinely new turns = 0 on repeat runs. - ingest: dry-run also shows accurate deduped vs would-import split - recall: fix intent expansion to match aliases that appear *within* the query (not the query within the alias). Loads all intents and does substring matching in Rust instead of SQL LIKE '%query%'. Previously 'CDS workflow' would not expand to 'clinical decision support'; now it correctly does.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ng, transcripts) (#20)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18e1669965
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Merge from main introduced duplicate match arms that were already present earlier in the match block, causing unreachable pattern warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9d8a8b1fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@ChrisCompton ready for your review and merge approval |
- UTF-8 safe truncation in apply_size_policy (P1) - Validate --days is non-negative (P2) - Fetch larger set before agent_id filter to honour limit correctly (P2) - Restore /recall and /events HTTP routes lost during rebase (P1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Release v0.2.0
Merges all recall quality phases (5–9) plus vec0.so static linking fix (v0.1.1) into main.
See the phase4-recall-quality PR for the detailed changelog.
PR Review by Greptile
Greptile Summary
This release (v0.2.0) merges phases 5–9 of the recall quality initiative plus the critical sqlite-vec static linking fix from v0.1.1.
Major additions:
.sodependency viasqlite3_auto_extensionwithOnceLockfor thread-safe one-time registrationderived_from), connections (related_to), link/neighbors commands, and document reconstructionstats,gc,decay,audit-qualitycommands; salience decay with configurable half-lifecanoncommands (get/set/list),recallcontext packs,reconcilefor quality checks,sleepreflection,morningbriefsagent:<id>tags)Documentation:
MEMORY_DOCTRINE.md,CANONICALS.md,WORKFLOWS.md,OPENCLAW_INTEGRATION.mdsqlite-vec.md(reflects static linking),README.md(acknowledges sqlite-vec)All changes are well-structured, include proper error handling, and maintain backward compatibility. The static linking fix significantly improves deployment ergonomics.
Confidence Score: 5/5
Important Files Changed
.soloading with static linking viasqlite3_auto_extension; usesOnceLockfor thread-safe one-time registrationMemoryEdge,IntentItem, andMemoryHint(compact 51-byte binary format) types for graph and intent features.sorequired) and adds acknowledgements section.sopath configurationsqlite-vec(v0.1.7-alpha.10) andlibsql-ffi(v0.5) dependencies for static linkingFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD CLI[wagl CLI<br/>main.rs] Server[HTTP Server<br/>Axum + WebSocket] DB[(MemoryDb<br/>libSQL)] Vec[sqlite-vec<br/>static linked] CLI -->|put/query/recall| DB CLI -->|wagl serve| Server Server -->|REST API| DB Server -->|WebSocket events| Agents[External Agents] DB -->|vector search| Vec subgraph "New Phase 5-9 Features" Graph[Memory Graph<br/>edges/pathways] Intent[Intent System<br/>term mappings] Trust[People & Trust<br/>-5 to +5 scale] Ingest[Transcript Ingest<br/>redaction + dedupe] Canon[Canonical Memory<br/>single source of truth] end DB --> Graph DB --> Intent DB --> Trust CLI -->|wagl ingest| Ingest Ingest --> DB CLI -->|wagl canon| Canon Canon --> DB style Vec fill:#e1f5ff style Server fill:#fff4e1 style Graph fill:#e8f5e9 style Intent fill:#e8f5e9 style Trust fill:#e8f5e9 style Ingest fill:#e8f5e9 style Canon fill:#e8f5e9Last reviewed commit: e9d8a8b