You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: restructure README and command help by persona
Separate developer vs agent vs ad-hoc touchpoints with clear tables
showing what the user does and what Rekal does in response. Update
push and sync Long help to explain data ownership and compaction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.**Commit.** You commit code as usual. The post-commit hook runs `rekal checkpoint`, which snapshots your active AI session into `data.db`. Append-only — nothing is ever modified or deleted.
135
+
### Developer touchpoints
136
136
137
-
2.**Push.**`rekal push` encodes your data into a compact wire format (zstd compression, string interning) and writes it to your personal orphan branch `rekal/<your-email>`. Your git history stays clean — rekal data lives on a separate branch.
|`git commit`| Hook runs `rekal checkpoint` — snapshots your active AI session into `data.db` (append-only) |
141
+
|`git push`| Hook runs `rekal push` — encodes only your unexported data into compact wire format (zstd + string interning) and pushes to your orphan branch `rekal/<email>`|
142
+
|`rekal sync` (manual, when you want team context) | Fetches teammates' orphan branches, imports their sessions into your local DB and rebuilds the search index |
143
+
|`rekal clean` (if needed) | Removes `.rekal/` and hooks from the repo |
138
144
139
-
3.**Sync.**`rekal sync` pulls your teammates' orphan branches and imports their session data into your local index.
145
+
Day-to-day: commit and push as normal. Everything else is automatic.
140
146
141
-
4.**Recall.**`rekal "query"` runs a three-signal hybrid search (BM25 full-text, LSA embeddings, Nomic deep semantic embeddings) and returns scored results. The agent picks what matters.
147
+
### Agent touchpoints
142
148
143
-
### Two databases
149
+
| Agent does | Rekal does |
150
+
|------------|------------|
151
+
|`rekal "auth middleware"`| Runs hybrid search (BM25 + LSA + Nomic), returns scored JSON with `snippet_turn_index` pointing to the best-matching turn |
152
+
|`rekal query --session <id> --offset N --limit 5`| Returns a small window of turns around the relevant part of the conversation, with `has_more` for pagination |
153
+
|`rekal query --session <id> --role human`| Returns only human turns — cheapest way to understand session intent |
154
+
|`rekal query --session <id> --full`| Returns everything: turns, tool calls, files touched — only when the agent needs full detail |
|`rekal sync` (optional, at session start) | Pulls team context before the agent starts working |
144
157
145
-
Rekal keeps two local DuckDB databases. The split is deliberate.
158
+
The agent controls how much context it loads. Search first, drill down progressively, full sessions only when needed.
146
159
147
-
-**data.db** — The shared truth. Append-only. Contains sessions, turns, tool calls, checkpoints, files touched. This is what gets encoded and pushed through git. `rekal query` reads from here.
-**index.db** — Local intelligence. Full-text indexes, vector embeddings, file co-occurrence graphs. Never synced. Rebuilt anytime with `rekal index`. This is what powers `rekal "query"` search.
164
+
# Agent finds a relevant session, drills into the matching turn
Rekal data lives on git orphan branches named `rekal/<email>`. These branches have no common ancestor with your code branches — they do not appear in your project history, do not affect merges, and do not clutter your working tree. Standard git push and fetch move the data.
173
+
```bash
174
+
# Raw SQL for edge cases
175
+
rekal query "SELECT id, user_email, branch FROM sessions ORDER BY captured_at DESC LIMIT 5"
156
176
157
-
## Using Rekal with your agent
177
+
# Rebuild the search index after manual DB changes
178
+
rekal index
158
179
159
-
Rekal is agent-first. The agent is the primary consumer.
180
+
# View recent checkpoints
181
+
rekal log
182
+
```
160
183
161
-
When you run `rekal init`, it installs a Claude Code skill that teaches the agent how to use Rekal. The agent learns to search for prior context before modifying files, load sessions progressively to stay within token budgets, and use the structured output to make informed decisions.
184
+
### Two databases
162
185
163
-
The agent workflow:
186
+
Rekal keeps two local DuckDB databases. The split is deliberate.
-**data.db** — The shared truth. Append-only. Contains sessions, turns, tool calls, checkpoints, files touched. This is what gets encoded and pushed through git. `rekal query` reads from here.
168
189
169
-
# Agent finds a relevant session, drills in
170
-
rekal query --session 01JNQX... --limit 5
190
+
-**index.db** — Local intelligence. Full-text indexes, vector embeddings, file co-occurrence graphs. Never synced. Rebuilt anytime with `rekal index`. This is what powers `rekal "query"` search.
171
191
172
-
# Agent loads more detail if needed
173
-
rekal query --session 01JNQX... --full
174
-
```
192
+
Thin on the wire, rich on the machine.
175
193
176
-
The agent controls how much context it loads. Lightweight search first, full sessions only when needed.
194
+
### Orphan branches
195
+
196
+
Rekal data lives on git orphan branches named `rekal/<email>`. These branches have no common ancestor with your code branches — they do not appear in your project history, do not affect merges, and do not clutter your working tree. Standard git push and fetch move the data.
0 commit comments