Master orchestrator that plans, delegates to specialist tools, and generates cited answers with interactive charts — streaming via SSE
Documentation Index
Fetch the complete documentation index at: https://docs.ivory.finance/llms.txt
Use this file to discover all available pages before exploring further.
Phase 0 — Planning
plan tool to decompose the query into an ordered task list. This plan is emitted as a plan SSE event before any research begins — giving your UI an immediate preview of the research strategy.Phase 1 — Tool loop (up to 5 turns)
research_sec_filing internally runs search_filings followed by retrieve_from_filing in a single orchestrator step.Every tool call emits agent_step SSE events (running → done) so your UI can show live progress.| Tier | Label | Source |
|---|---|---|
| 1 | SEC Periodic Filing (Audited) | research_sec_filing — 10-K, 10-Q, 20-F, 40-F |
| 2 | Official Company (Unaudited) | research_sec_filing — 8-K, 6-K; search_transcripts; search_exhibits; NGX/JSE filings |
| 3 | Expert Reference | web_search with service: wikipedia or service: arxiv |
| 4 | Financial News Media | news_search all services; web_search reuters |
| 5 | General Web / User Document | web_search google/yahoo; retrieve_from_document; read_editor_document |
| 6 | Social Media | web_search reddit/x — noise, never stated as fact |
research_sec_filing — Find + retrieve in one step
search_filings to locate relevant filings, then retrieve_from_filing on the best matches. Returns both a filing discovery list and semantic chunk excerpts — one orchestrator step instead of two.| Parameter | Type | Description |
|---|---|---|
query | string ✓ | Semantic search query for retrieving content |
cik | string | 10-digit SEC CIK (zero-padded). Provide for faster, precise lookup. |
company_name | string | Company name (fuzzy match). Use when CIK is unknown. |
form_types | string[] | Filter to specific forms: 10-K, 10-Q, 8-K, 6-K, 20-F, DEF 14A, etc. |
after_date | string | ISO date lower bound (YYYY-MM-DD) |
before_date | string | ISO date upper bound (YYYY-MM-DD) |
max_filings | integer | Cap on filings to retrieve (default: 2) |
0001018724, Microsoft=0000789019, Tesla=0001318605, Alphabet=0001652044, Meta=0001326801, NVIDIA=0001045810, Apple=0000320193, Netflix=0001065280.Source tier: 1 (10-K/10-Q/20-F/40-F) or 2 (8-K/6-K)web_search — General web search
| Service | Best for | Source tier |
|---|---|---|
google | General research | 5 |
wikipedia | Definitions, company overview, history | 3 |
arxiv | Academic papers, ML/AI research | 3 |
yahoo | Financial data, stock info | 5 |
reddit | Community sentiment, qualitative | 6 |
x | Real-time market commentary | 6 |
news_search — Financial news
research_sec_filing to confirm the right reporting period.| Service | Source tier |
|---|---|
google (default) | 4 |
reuters | 4 |
yahoo | 4 |
query_database — SQL / NoSQL query
config.db_connection_string. See Agent Configuration for supported schemes.analyze_filing_risks — Risk keyword extraction
| Category | Example keywords |
|---|---|
| Litigation | lawsuit, class action, settlement, arbitration, subpoena |
| Liquidity | going concern, covenant, default, working capital, refinancing |
| Regulatory | fine, penalty, sanction, enforcement, corrective action |
| Market | volatility, recession, tariff, macroeconomic, pricing pressure |
| Operational | supply chain, cybersecurity breach, outage, recall, shortage |
| Governance | restatement, material weakness, internal control, fraud, related party |
generate_chart to visualise the results.generate_chart — Plotly JSON chart
chart SSE event — no frontend code required beyond calling Plotly.newPlot().See Visualization for the full chart type reference.query_graph — FalkorDB Cypher graph
Company, Person, Filing, EarningsCall, Auditor, SectorKey edges: HELD_CALL, SPOKE_AT {role, section}, ANALYZED_AT {firm}, TRADED {transaction_code, shares, price_per_share, total_value}run_comps_analysis — Sector-peer comparables
| Parameter | Default | Description |
|---|---|---|
cik | ✓ | CIK of the focal company |
min_similarity | 40 | Minimum similarity score (0–100) to include a peer |
analyze_earnings — Earnings brief + transcript highlights
fiscal_year and quarter to get the most recent quarter.generate_excel — Export to .xlsx workbook
export_type | Content |
|---|---|
financials | Income statement, balance sheet, cash flow |
comps | Peer comparison table |
revenue_segments | Revenue breakdown by segment and period |
dcf_inputs | DCF model inputs |
search_transcripts — Earnings call transcripts
| Parameter | Description |
|---|---|
query | Semantic search query |
ticker | Filter by ticker symbol |
company_name | Filter by company name (fuzzy match) |
after_date / before_date | Date range bounds (YYYY-MM-DD) |
limit | Max chunks to return (default 5) |
search_exhibits — Press releases & investor exhibits
| Parameter | Description |
|---|---|
exhibit_type | Filter by exhibit type (e.g. EX-99.1, EX-99.2) |
retrieve_from_document — User-uploaded document
doc_id. The document must have been uploaded and indexed via client_id + document_ids in the request.client_id and document_ids to be set in the API request body. Returns [D1], [D2], … citations.Source tier: 5 — User Document (unverified)search_uk_ch — UK Companies House filings
| Parameter | Description |
|---|---|
company_name | UK company name (fuzzy match) |
crn | Companies House Registration Number |
form_type | Filing type (e.g. AA=Annual accounts, CS01=Confirmation statement) |
search_uk_fca — UK FCA regulatory filings
search_ng_filings — Nigerian NGX / SEC filings
read_editor_document — Read an Ivory Editor document
search_editor_documents — Search Ivory Editor documents
scope | Searches |
|---|---|
private | Only the requesting user’s own documents |
public | All publicly shared documents (any user) |
all (default) | Both private and public |
visibility to public.Source tier: 5 — User Editor Document (unverified)write_to_editor_document — Write content into a document
updated_by_type='agent' for full audit traceability.operation | Behaviour |
|---|---|
append (default) | Add blocks to the END of the document |
prepend | Add blocks to the BEGINNING |
replace_all | Replace the entire document body (use with caution) |
create_sec_citation_block — Insert SEC citation into document
sec_citation smart block from a filing and appends it to an editor document. Combines KNN search within the filing + block formatting + document write in one step.doc_id is provided the block is automatically appended.See Smart Blocks — sec_citation for the full block schema.create_market_data_block — Insert financial metrics into document
market_data smart block to an editor document.cik or ticker. See Smart Blocks — market_data for the full block schema.create_chart_block — Insert Plotly chart into document
ivory_chart smart block to an editor document. Identical spec format to generate_chart — use this when inserting into a document vs. generating for the answer.| Field | Type | Description |
|---|---|---|
chat_id | string | null | Opaque ID echoed back in conversation_state. Route the updated history to the right record. |
conversation_history | ConversationTurn[] | Prior user/assistant turns injected before the current query. Supersedes session_id when both are provided. |
conversation_state event is emitted just before done, containing all user-facing turns including the current exchange. Persist this for the next request.
text/event-stream. Each line: data: <JSON>.
| Event | When | Key fields |
|---|---|---|
plan | After planning phase | steps: [{agent, task}] |
agent_step running | Tool called | tool, args, status: "running" |
agent_step done | Tool result ready | tool, status: "done", summary |
sources | Before first token | sources[], web_sources[], doc_sources[] |
chart | Per generated chart | chart_id, title, chart_type, plotly: {data, layout} |
token | Per output token | token |
conversation_state | Before done | chat_id, messages[] |
done | End of stream | — |
error | On failure | detail |
| Bracket | Source type | Comes from |
|---|---|---|
[S1], [S2], … | SEC filing chunks | research_sec_filing → sources[] |
[W1], [W2], … | Web search results | web_search → web_sources[] |
[N1], [N2], … | News results | news_search → web_sources[] |
[D1], [D2], … | User-uploaded document chunks | retrieve_from_document → doc_sources[] |
[Chart 1], … | Generated Plotly charts | generate_chart → chart events |
Optional per-request agent configuration. All fields fall back to server-side environment variables when not provided.
LLM llm_provider: "openai" (default) | "anthropic" | "deepseek" llm_model: e.g. "gpt-4o", "claude-opus-4-6", "deepseek-chat" (DeepSeek V3), "deepseek-reasoner" (R1)
Web / news search search_provider: "google" (default) | "bing" | "duckduckgo" | "custom" search_api_key: API key for Bing or custom provider (not needed for Google/DuckDuckGo) search_custom_url: Base URL for "custom" provider (e.g. "https://search.myco.com")
Database db_connection_string: Connection string for the query_database tool. Supported schemes: postgresql://, mysql://, mariadb://, mongodb://, oracle://, redshift://, snowflake://, databricks://, bigquery:// If omitted, the server DATABASE_URL env var is used.
Successful Response