Home / Guides / LLM workflows
LLM workflows

SEC filing tools for CrewAI agents

Give CrewAI agents 10-K and 10-Q sections, XBRL financial statements, insider trades and 8-K reports with the open source secfeed-crewai package, then run a three agent stock research crew.

CrewAI agents are only as good as the data their tools return. For public companies, the best primary source is what they file with the SEC. The open source secfeed-crewai package gives a crew five ready tools backed by SecFeed: the right section of the latest 10-K or 10-Q, XBRL financial statements, Form 4 insider trades and recent 8-K reports.

Every tool returns compact text sized for a model's context window, with a link to the source filing, so your agents can cite what they read.

Install

pip install secfeed-crewai
export SECFEED_API_KEY=sf_...

Get a key from your dashboard. The package depends on crewai and the secfeed SDK. CrewAI itself needs Python 3.10 to 3.13.

Give an agent the tools

from crewai import Agent
from secfeed_crewai import SearchTenKTool, SearchTenQTool, FinancialStatementsTool, InsiderTradesTool, RecentEightKTool

analyst = Agent(
    role="Equity analyst",
    goal="Explain a company's risks and financial health from its filings",
    backstory="You only trust primary sources and you cite every filing you use.",
    tools=[SearchTenKTool(), SearchTenQTool(), FinancialStatementsTool(), InsiderTradesTool(), RecentEightKTool()],
)

all_tools() returns the same five tools in one list.

ToolReturnsAPI calls
SearchTenKToolParagraphs of the latest 10-K that answer the question, from Business, Risk Factors, MD&A or Market Risk2
SearchTenQToolSame for the latest 10-Q2
FinancialStatementsToolIncome statement, balance sheet and cash flow from XBRL, latest periods side by side1
InsiderTradesToolLatest Form 4 transactions with role, buy or sell, shares, price, value and the 10b5-1 flag1
RecentEightKToolLatest 8-K reports and the items each one covers2

Repeat questions about the same filing are cached inside the process, so an agent that asks five questions about one 10-K pays for the section once.

What the agent sees

The filing search tools find the latest filing with the Filing Query API, pull one section with the Section Extractor, then keep the paragraphs that share the most words with the question. You can call the plain function behind a tool to see its output:

from secfeed_crewai import core

print(core.search_filing("NVDA", "What does the company say about export controls on China?"))

Output (first lines):

NVIDIA CORP (NVDA) 10-K filed 2026-02-25, section: Business
Source: https://www.sec.gov/Archives/edgar/data/1045810/000104581026000021/0001045810-26-000021-index.htm

Over the past three years, we have been subject to a series of shifting and expanding export control restrictions, impacting our ability to serve customers outside the United States.

In August 2022, the U.S. government, or USG, announced export restrictions and export licensing requirements targeting China’s semiconductor and supercomputing industries.

The financial statements tool flattens the Financial Statements API response into one line per concept:

print(core.financials("NVDA"))
NVDA 10-K financial statements (accession 0001045810-26-000021), USD unless noted

StatementsOfIncome
  Revenues: 2026-01-25: 215.94B; 2025-01-26: 130.50B
  CostOfRevenue: 2026-01-25: 62.48B; 2025-01-26: 32.64B
  GrossProfit: 2026-01-25: 153.46B; 2025-01-26: 97.86B
  ResearchAndDevelopmentExpense: 2026-01-25: 18.50B; 2025-01-26: 12.91B

And the 8-K tool lists what each recent current report covers, from the 8-K events API:

print(core.recent_8k("NVDA", limit=3))
NVIDIA CORP (NVDA) latest 8-K reports:
- 2026-11-12: 5.02 Departure or Appointment of Directors or Officers; Compensatory Arrangements; 9.01 Financial Statements and Exhibits  https://www.sec.gov/Archives/edgar/data/1045810/000104581026000082/0001045810-26-000082-index.htm
- 2026-09-03: 8.01 Other Events  https://www.sec.gov/Archives/edgar/data/1045810/000104581026000078/0001045810-26-000078-index.htm
- 2026-08-26: 2.02 Results of Operations and Financial Condition; 9.01 Financial Statements and Exhibits  https://www.sec.gov/Archives/edgar/data/1045810/000104581026000073/0001045810-26-000073-index.htm

Run the stock research crew

The repository includes a sequential crew of three agents: a filings researcher (10-K, 10-Q and 8-K tools), a financial analyst (financial statements and insider trades) and a memo writer. It writes memo-<TICKER>.md.

git clone https://github.com/secfeedapi/secfeed-crewai && cd secfeed-crewai
export OPENAI_API_KEY=...      # or MODEL=anthropic/<model>, MODEL=openrouter/<model>
python examples/stock_analysis/main.py AMD

In our test run on AMD the crew made 16 tool calls, which cost 11 SecFeed API calls thanks to the cache, and wrote a memo with revenue growth, margins, cash and debt, insider activity and links to every filing it used.

Coming from the CrewAI stock analysis example

The well known CrewAI stock analysis example searches 10-K and 10-Q filings by downloading the whole filing page, splitting it into chunks and embedding them with OpenAI. That needs unstructured, a vector store and an embeddings key, and the retriever often returns chunks from the table of contents or the exhibits list.

Swapping in these tools is two lines:

# before
from tools.sec_tools import SECTools
tools = [SECTools.search_10q, SECTools.search_10k]

# after
from secfeed_crewai import SearchTenQTool, SearchTenKTool
tools = [SearchTenQTool(), SearchTenKTool()]

The agent then reads the actual section that answers its question, and you can drop the embeddings dependency.

More llm workflows guides

Run this guide with your own key

Free key, no card needed. Every example on this page works on the free plan.

Get free API key →