Use LangGraph for workflow state and SolarflareDB for temporal context
LangGraph separates thread-scoped persistence through checkpointers from long-term, cross-thread data through stores. A SolarflareDB integration should preserve that separation rather than replacing graph execution state.
Keep checkpoints, interrupts, and resumable workflow state in the LangGraph checkpointer. Use SolarflareDB for durable episodes, user and project facts, entity relationships, provenance, current/as-of truth, and hybrid retrieval across threads.
Write memories after meaningful workflow events
Use an after-node hook, application event handler, or explicit tool to write episodes only when they have durable value. Bind the tenant, user, thread, graph run, node, and source message to the operation envelope.
write = solarflare.memory.remember(
agent="researcher",
episode=state["decision_summary"],
source={"type": "langgraph_run", "id": run_id},
idempotency_key=f"{run_id}:decision-summary",
)
A repeated workflow step can safely reuse the idempotency key without creating another billed mutation.
Retrieve before the model step with an explicit budget
Query SolarflareDB in a node that receives the current task, user, project, and temporal boundary. Select a compact context set, then place structured facts and source references into graph state rather than appending an unlimited history.
context = solarflare.context.query(
query=state["messages"][-1].content,
scopes=[f"user:{user_id}", f"project:{project_id}"],
current=True,
max_tokens=1200,
explain=True,
)
Carry bookmarks through graph state
After a memory write, store the returned bookmark in LangGraph state. A following retrieval can require after=bookmark. If derived indexes have not caught up, SolarflareDB’s recent-write overlay supplies the new context or reports the lagging projection.
This makes read-your-writes behavior an explicit part of the workflow rather than a sleep or retry guess.
Production checklist
- Namespace every memory by tenant and application subject.
- Use one idempotency key per durable workflow event.
- Keep checkpoint data and long-term context retention policies separate.
- Log retrieval explanation and context token count alongside graph traces.
- Set project spend ceilings and per-run query budgets.
- Test replay, duplicate workflow delivery, and memory conflicts.