example: add Information Cascade model to benchmark STLTMemory latency#251
example: add Information Cascade model to benchmark STLTMemory latency#251ZhehaoZhao423 wants to merge 3 commits intomesa:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use your project's `pylint` configuration to improve the quality of Python code reviews.Add a pylint configuration file to your project to customize how CodeRabbit runs |
Pre-PR Checklist
Approval Link
None yet. This PR is a proactive submission following the creation of Issue #246. I'm opening this now to provide a concrete working implementation for the maintainers to evaluate alongside the feature request.
Summary
This PR introduces a new agent-based model example: Information Cascade (Financial Rumor Mill). It simulates a volatile stock market where LLM-powered quantitative traders make decisions (BUY/SELL/HOLD) based on peer-to-peer rumors and their internal
STLTMemory.Motive
This feature addresses the ongoing performance concerns regarding API latency and event-loop blocking (discussed in #200).
short_term_capacity=1, this model forces continuousSTLTMemoryconsolidation, providing a reproducible environment to measure synchronous API blocking.Implementation
MarketPanicModelandTraderAgentwith custom rumor-broadcasting logic. Used strict system prompting to prevent agents from hallucinating spatial interactions (move_one_step).run_benchmark.py, a headless script to profile step-execution time.app.pyusing rawsolarareactive components with strict CSS formatting. This approach bypasses the currentSolaraVizNoneType initialization conflict, ensuring a robust demonstration even with high-latency LLM calls.docs/examples.md.Usage Examples
To run the performance benchmark (headless):
cd examples/information_cascade python run_benchmark.pyTo launch the visualization:
cd examples/information_cascade solara run app.py(Feel free to run the app to see the complete terminal-style CoT logs rendered in the browser!)
Additional Notes
pre-commit(Ruff/Black) to ensure strict compliance with project standards..envfile with a validDEEPSEEK_API_KEY(or other LiteLLM-compatible keys).