Skip to content

References: Memory and reflection

For education only. Not investment, financial, or trading advice.

Primary source (open-source, Apache-2.0):
- TradingAgents, an open-source multi-agent LLM framework
Authors: Yijia Xiao, Edward Sun, Di Luo, Wei Wang
Organization: TauricResearch
Repository: https://github.com/TauricResearch/TradingAgents
Paper: "TradingAgents: Multi-Agents LLM Financial Trading Framework",
arXiv:2412.20138 (https://arxiv.org/abs/2412.20138)
License: Apache-2.0
Pinned snapshot for this course: 7e9e7b8 (the framework as of 2026-05-01)
All code shown in this lesson is quoted from the framework at the pinned
snapshot above, under the Apache-2.0 license, with attribution. Clawdemy's
lesson prose is original. We teach the architecture only; we make no
investment, financial, or trading claims, and we report no performance results.

The framework is public and free to read. You do not need a GitHub account, the tool called Git, or any programming knowledge: open the link below in your browser and read the files like ordinary web pages.

At the pinned snapshot:

  • tradingagents/agents/utils/memory.py: the append-only logbook. It records a decision as a pending entry (no model), and later resolves it with the reflection.
  • tradingagents/graph/reflection.py: the reflection step, built with the cheaper model. Given a past decision and its outcome, it writes a few plain sentences of lessons learned.
  • tradingagents/graph/trading_graph.py: the loop that ties it together. At the start of a run it resolves earlier pending entries for the same company and injects the past context; at the end it records the new decision.

Where this sits inside this track.

  • Orchestration and shared state. The previous lesson: the shared state that the memory log is read into and written back from.
  • The risk gate. The portfolio manager introduced there is the one agent that reads the accumulated memory when it makes the final call.
  • The capstone. The final lesson: run the whole system yourself in a safe simulation, with your own AI provider key.