Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Example: Chart Library research crew (researcher + analyst)#374

Draft
grahammccain wants to merge 1 commit intocrewAIInc:mainfrom
grahammccain:chart-library-research-crew
Draft

Example: Chart Library research crew (researcher + analyst)#374
grahammccain wants to merge 1 commit intocrewAIInc:mainfrom
grahammccain:chart-library-research-crew

Conversation

@grahammccain
Copy link
Copy Markdown

Adds a two-agent sequential Crew demonstrating the grounded-base-rates pattern for financial research.

The pattern

  • Researcher — has tool access (get_cohort_distribution, explain_cohort_filters, refine_cohort_with_filters), no narrative license. Produces a numeric-only report.
  • Analyst — has narrative license, no tool access. Turns numbers into a 150-word PM briefing.

The role separation enforces that every written claim maps back to a real retrieved number — a structural defense against hallucinated base rates in finance agents.

Tools

Wraps three HTTP endpoints from Chart Library:

  • get_cohort_distribution(symbol, date, filters) → historical forward-return percentiles, MAE/MFE, realized vol, survivorship flag, named-event tags
  • explain_cohort_filters(cohort_id) → ranks which filter would shift the distribution most
  • refine_cohort_with_filters(cohort_id, extra_filters) → sub-second refinement of the stored cohort

Running

pip install crewai crewai-tools requests
export OPENAI_API_KEY=sk-...            # or swap for Anthropic
export CHART_LIBRARY_KEY=cl_...         # free at chartlibrary.io/developers
python cohort_research_crew.py NVDA 2024-06-18

About Chart Library

Open API serving 24M historical chart-pattern embeddings, 15K+ US equities, 10-year history. Free sandbox tier (200 calls/day). MCP server: pip install chartlibrary-mcp.

Draft for now — happy to adjust directory placement or style to match current crewAI-examples conventions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant