feat(cookbook): add crash-resilient LangGraph financial analyst - #95
Open
wangshen-tech wants to merge 1 commit into
Open
feat(cookbook): add crash-resilient LangGraph financial analyst#95wangshen-tech wants to merge 1 commit into
wangshen-tech wants to merge 1 commit into
Conversation
sdageltc
reviewed
Aug 31, 2026
sdageltc
left a comment
Owner
There was a problem hiding this comment.
Hi @wangshen-tech! Thank you so much for putting together this comprehensive LangGraph financial analyst cookbook using yfinance and DeepSeek! 🚀
The cookbook logic and test structure look great. However, this branch was created from an older base commit before our recent v0.5.2 Multi-Framework Adapter Suite release (letitloop/adapters/). As a result, merging directly would cause conflicts and remove existing adapter files.
Could you please rebase your branch against the latest origin/main?
git fetch origin
git checkout feat/issue-82-financial-agent
git rebase origin/main
# If any merge conflicts arise in README.md / CHANGELOG.md, resolve them keeping both the adapters and your new cookbook section
git push --force-with-leaseOnce rebased, we will run the test matrix and merge immediately. Thank you for the awesome contribution!
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.
Description
Adds a real-world LangGraph financial analyst cookbook using yfinance, DeepSeek, and LetItLoop
@durable_asynccheckpoints.Closes #82
Architecture
The compiled async
StateGraphruns four durable nodes:Every node executes through
await async_step(...), so completed JSON-safe outputs are committed to LetItLoop's WAL before the graph advances.Installation and usage
API keys are read only from the environment and are never persisted in WAL or the independent call log.
SIGKILL recovery proof
On POSIX, the demo sends a real
SIGKILLimmediately aftergenerate_investment_memoreturns from its durable step. Windows uses exit 137 because it has no POSIXSIGKILL.At the interruption point, WAL contains exactly:
fetch_market_datacompute_indicatorsgenerate_investment_memogenerate_reportis still absent. A separate fsynced JSONL receipt log audits successful market and LLM calls independently of WAL.Observed live AAPL + DeepSeek demo:
This demonstrates zero re-fetching, zero duplicate LLM calls, and 0% duplicate token consumption for already committed steps. These are the live provider's actual usage fields; offline mode uses deterministic simulated accounting without making a paid request.
The guarantee is intentionally scoped to committed steps. If a process dies after an external provider receives a request but before that result is committed, exactly-once billing requires provider-side idempotency and is not claimed here.
<1msmeasurement scopeThe demo initializes and loads WAL first, then times only these in-memory calls:
The fallback callback raises if any underlying function executes. Python startup, imports, WAL initialization, graph construction, and the unfinished report node are excluded.
Observed locally:
fetch_market_data: 0.006mscompute_indicators: 0.002msgenerate_investment_memo: 0.001msCI uses a relaxed 25ms ceiling to avoid timing flakes while still strictly verifying that the callbacks are not executed.
Coverage
StateGraph.compile()+await graph.ainvoke(...)orchestrator.llm.call_llmVerification
A live AAPL + DeepSeek post-memo SIGKILL demo completed successfully with exit code 0 and 1059 provider-reported tokens before and after recovery. No API key is included in this change.