{"id":"b9ec2292-e285-4a5e-b132-dd5983c0b634","entityType":"agent","slug":"crewai-bganguly-edgar-agent","name":"edgar-agent","canonicalUrl":"https://www.xpersona.co/agent/crewai-bganguly-edgar-agent","canonicalPath":"/agent/crewai-bganguly-edgar-agent","generatedAt":"2026-10-09T18:14:13.442Z","source":"GITHUB_REPOS","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":null},"description":"Manual Anthropic tool-use agent over SEC EDGAR 10-K filings — no LangChain, no CrewAI. Tool calls and tokens stream live via SSE; NVIDIA NIM works as a drop-in provider. FastAPI + React. EDGAR Agent — Manual Agent Loop · FastAPI · React · Anthropic / NVIDIA NIM Full-stack AI agent that answers questions about public companies by fetching SEC EDGAR 10-K filings on demand. The agent loop is implemented manually — no LangChain, no CrewAI — using the Anthropic tool-use API or NVIDIA NIM's OpenAI-compatible function-calling interface. Responses stream token-by-token via SSE; tool calls are surfaced live i","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. Last updated 10/9/2026.","installCommand":null,"sourceUrl":"https://github.com/bganguly/edgar-agent","homepage":null,"primaryLinks":[{"label":"View Source","url":"https://github.com/bganguly/edgar-agent","kind":"source"}],"safetyScore":66,"overallRank":37.6,"popularityScore":0,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Manual Anthropic tool-use agent over SEC EDGAR 10-K filings — no LangChain, no CrewAI. Tool calls and tokens stream live via SSE; NVIDIA NIM works as a drop-in "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[{"label":"crewai","status":"self-declared"},{"label":"multi-agent","status":"self-declared"}],"verifiedCount":0,"selfDeclaredCount":3,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"crewai","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"},{"key":"multi-agent","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile capability:crewai|supported|profile capability:multi-agent|supported|profile"}},"adoption":{"evidence":{"source":"no-adoption-signals","verified":false,"confidence":"low","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":"No source adoption metrics were available."},"stars":0,"forks":0,"downloads":null,"packageName":null,"latestVersion":null,"tractionLabel":null},"release":{"evidence":{"source":"agent-index","verified":false,"confidence":"medium","updatedAt":"2026-10-09T11:16:34.378Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T11:16:34.383Z","lastCrawledAt":"2026-10-09T11:16:34.378Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-16T11:16:34.378Z","lastVerifiedAt":null,"highlights":[]},"execution":{"evidence":{"source":"GITHUB REPOS","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":null,"setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"GITHUB_REPOS","generatedAt":"2026-10-09T18:14:13.442Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/crewai-bganguly-edgar-agent/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"GITHUB REPOS","verified":false,"confidence":"high","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":null},"readme":"# EDGAR Agent — Manual Agent Loop · FastAPI · React · Anthropic / NVIDIA NIM\n\nFull-stack AI agent that answers questions about public companies by fetching SEC EDGAR 10-K filings on demand.\nThe agent loop is implemented manually — no LangChain, no CrewAI — using the Anthropic tool-use API or NVIDIA NIM's\nOpenAI-compatible function-calling interface. Responses stream token-by-token via SSE; tool calls are surfaced\nlive in the UI so you can watch the agent reason in real time.\n\n---\n\n## Live Service\n\n| Endpoint | URL |\n|---|---|\n| **App** | https://edgar-frontend-77y7e2wykq-uc.a.run.app |\n| **API Explorer** | https://edgar-frontend-77y7e2wykq-uc.a.run.app/api-explorer |\n| **Portfolio demo** | https://bganguly.github.io/#edgar_10k_agent |\n\n> Cloud Run scales to zero when idle; first request may take ~5–10 s to wake.\n\n---\n\n## Using the App\n\n### Single-turn queries\n\nType any natural-language question about a public company. The agent will:\n1. Call `search_edgar` to find matching 10-K filings on SEC EDGAR.\n2. Call `fetch_filing` on the most relevant result and extract readable text.\n3. Stream a cited answer based on the filing content.\n\nGood first queries:\n\n- *\"What was Apple's revenue for fiscal year 2023?\"*\n- *\"Summarize Tesla's risk factors from their latest 10-K.\"*\n- *\"What does Nvidia say about its data center business?\"*\n\n### Sustained multi-turn conversation\n\nThe backend stores the full message history per session in memory. Pass the `session_id` returned in\nthe first response back on every subsequent request and the agent will have full context of everything\nalready fetched and discussed — it will not re-search EDGAR unless you explicitly ask about a new company\nor a different filing period.\n\n**Patterns that work well across turns:**\n\n| What you want | How to phrase it |\n|:--|:--|\n| Follow up on the same filing | *\"What does the same filing say about operating expenses?\"* |\n| Compare across years | *\"Now fetch their 2021 10-K and compare revenue growth.\"* |\n| Compare two companies | *\"Do the same search for Microsoft and compare margins.\"* |\n| Drill into a specific section | *\"Go back to the risk-factors section — any mention of supply chain?\"* |\n| Summarise the session so far | *\"Give me a one-paragraph summary of everything we've discussed.\"* |\n\n**Practical tips:**\n\n- **Session ID is the continuity key.** The UI holds it automatically; if you call the API directly, echo the `session_id` event from the first response and include it in every subsequent `POST /chat` body.\n- **In-memory only.** Sessions are not persisted to disk — restarting the backend clears all history. Start a new conversation rather than expecting to resume after a restart.\n- **12 K char filing cap.** `fetch_filing` returns at most the first 12 000 characters of a filing. For very long 10-Ks the agent may miss later sections; ask it to *\"fetch the filing index page and look for the specific exhibit\"* if you need a deeper section.\n- **Tool visibility.** Every `tool_call` SSE event names the tool and its input. If the agent searches for the wrong company name (e.g., ticker vs. legal name), correct it in the next message: *\"Search for 'Alphabet Inc' instead of 'Google'.\"*\n- **Provider switch.** Set `MODEL_PROVIDER=nvidia` in `.env` and restart the backend to switch to Nemotron. The same session history works — the format translation happens inside `run_agent_nvidia`.\n\n---\n\n## Architecture\n\n### Agent loop — step by step\n\n1. **Browser → FastAPI** — `POST /chat { message, session_id? }` arrives; FastAPI loads the session's message history and appends the new user message.\n2. **FastAPI → Anthropic** — `messages.create(tools=[search_edgar, fetch_filing], messages=history)` is called with the full accumulated context.\n3. **`stop_reason == \"tool_use\"`** — the model decides to call a tool. The assistant turn (with `tool_use` blocks) is appended to the message list; tools are executed; results are appended as a `user` turn containing `tool_result` blocks.\n4. **Re-prompt** — `messages.create` is called again with the expanded history. Steps 3–4 repeat until the model is ready to answer.\n5. **`stop_reason == \"end_turn\"`** — the model produces a final answer. `messages.stream` replays the same call and yields tokens as `token` SSE events; the completed assistant message is persisted to the session.\n6. **Session persistence** — only the messages added after step 1 are appended; existing history is never re-written.\n\n```mermaid\nsequenceDiagram\n    participant B as Browser\n    participant F as FastAPI\n    participant A as Anthropic API\n    participant E as SEC EDGAR\n\n    B->>F: POST /chat { message, session_id }\n    F->>F: load session history\n    F->>A: messages.create(tools, history + user_msg)\n\n    loop while stop_reason == tool_use\n        A-->>F: tool_use block(s)\n        F-->>B: SSE tool_call event\n        F->>E: search_edgar / fetch_filing\n        E-->>F: filing URLs / filing text\n        F->>A: messages.create(history + tool_results)\n    end\n\n    A-->>F: final text (end_turn)\n    F-->>B: SSE token stream\n    F->>F: persist new messages to session\n    F-->>B: SSE session_id + done\n```\n\n### Multi-turn flow (second and later messages)\n\n```mermaid\nsequenceDiagram\n    participant B as Browser\n    participant F as FastAPI\n    participant A as Anthropic API\n\n    B->>F: POST /chat { message, session_id: \"existing-uuid\" }\n    F->>F: load prior history (user + assistant + tool turns)\n    F->>A: messages.create(full history + new user_msg)\n    Note over A: model has context of all<br/>prior filings and answers\n    A-->>F: answer (may skip tool calls if<br/>context already sufficient)\n    F-->>B: SSE token stream + done\n```\n\n### Key design decisions\n\n| Concern | Approach |\n|:--|:--|\n| **No framework** | Agent loop is a plain `while` loop; Anthropic's tool-use protocol is straightforward enough that LangChain adds no value and obscures the message list |\n| **Full history on every call** | The complete `messages` list is sent on every `messages.create` call — the model can reference any prior filing text or answer without re-fetching |\n| **Tool results as user turns** | Anthropic requires tool results in a `user` role message; NVIDIA NIM expects `role: \"tool\"` — `run_agent_nvidia` handles the format difference transparently |\n| **SSE over WebSocket** | One-directional server-push is sufficient; SSE is simpler to implement and works over standard HTTP without upgrade negotiation |\n| **In-memory sessions** | No Redis or DB dependency keeps local setup to a single `uvicorn` command; acceptable trade-off for a demo where session loss on restart is not a problem |\n| **12 K char filing cap** | Balances context-window cost vs. completeness; most material facts (revenue, risk factors, segment results) appear in the first third of a 10-K |\n| **Same embeddings constraint (N/A)** | This agent does no vector search — EDGAR text is injected directly into the LLM context, so there is no embedding mismatch risk |\n\n## Stack\n\n| Component | Implementation |\n|---|---|\n| **Agent loop** | Manual `while stop_reason == \"tool_use\"` loop; tool results appended as `user` messages per Anthropic's multi-turn tool-use protocol |\n| **Tools** | `search_edgar` — EDGAR full-text search API, returns top-5 10-K filing URLs; `fetch_filing` — HTTP GET + BeautifulSoup HTML strip, first 12 K chars |\n| **Default model** | `claude-sonnet-5` (Anthropic) — switched to NVIDIA NIM `llama-3.1-nemotron-ultra-253b-v1` via `MODEL_PROVIDER=nvidia` env var |\n| **Streaming** | FastAPI `EventSourceResponse` (sse-starlette); yields `token`, `tool_call`, `session_id`, and `done` event types |\n| **Session storage** | In-process `defaultdict(list)` keyed by UUID; no external DB required |\n| **Backend** | FastAPI 0.115, Python 3.11+; `uvicorn` for local dev; Dockerfile present for containerised deploy |\n| **Frontend** | React 18 + Vite + TypeScript; plain `fetch` EventSource consumer; no UI framework |\n| **Tests** | `simulation_tests.py` — 5 scripted keyword-match scenarios; `eval.py` — LLM-as-judge scoring (1–5) via `claude-sonnet-5` |\n\n---\n\n## Deployment / Running\n\n```bash\n./scripts/deploy.sh\n```\n\n---\n\n## API\n\n### `POST /chat`\n\n```json\n{ \"message\": \"What was Apple's revenue in 2023?\", \"session_id\": \"optional-uuid\" }\n```\n\nStreams SSE events:\n\n| Event type | Payload |\n|---|---|\n| `token` | `{\"type\":\"token\",\"text\":\"...\"}` |\n| `tool_call` | `{\"type\":\"tool_call\",\"tool\":\"search_edgar\",\"input\":{...}}` |\n| `session_id` | `{\"type\":\"session_id\",\"session_id\":\"uuid\"}` |\n| `done` | `{\"type\":\"done\",\"messages\":[...]}` |\n\n### `GET /sessions/{session_id}/history`\n\nReturns the full conversation history for a session.\n\n## Tests\n\nBackend must be running on port 8000.\n\n```\npython tests/simulation_tests.py\n```\n\n5 scripted scenarios — checks that answers contain expected keywords.\n\n```\npython tests/eval.py\n```\n\nLLM-as-judge (`claude-sonnet-5`) — scores each of 5 conversations 1–5 on relevance and accuracy, prints averages.\n","readmeExcerpt":"EDGAR Agent — Manual Agent Loop · FastAPI · React · Anthropic / NVIDIA NIM Full-stack AI agent that answers questions about public companies by fetching SEC EDGAR 10-K filings on demand. The agent loop is implemented manually — no LangChain, no CrewAI — using the Anthropic tool-use API or NVIDIA NIM's OpenAI-compatible function-calling interface. Responses stream token-by-token via SSE; tool calls are surfaced live i","codeSnippets":[],"executableExamples":[{"language":"mermaid","snippet":"sequenceDiagram\n    participant B as Browser\n    participant F as FastAPI\n    participant A as Anthropic API\n    participant E as SEC EDGAR\n\n    B->>F: POST /chat { message, session_id }\n    F->>F: load session history\n    F->>A: messages.create(tools, history + user_msg)\n\n    loop while stop_reason == tool_use\n        A-->>F: tool_use block(s)\n        F-->>B: SSE tool_call event\n        F->>E: search_edgar / fetch_filing\n        E-->>F: filing URLs / filing text\n        F->>A: messages.create(history + tool_results)\n    end\n\n    A-->>F: final text (end_turn)\n    F-->>B: SSE token stream\n    F->>F: persist new messages to session\n    F-->>B: SSE session_id + done"},{"language":"mermaid","snippet":"sequenceDiagram\n    participant B as Browser\n    participant F as FastAPI\n    participant A as Anthropic API\n\n    B->>F: POST /chat { message, session_id: \"existing-uuid\" }\n    F->>F: load prior history (user + assistant + tool turns)\n    F->>A: messages.create(full history + new user_msg)\n    Note over A: model has context of all<br/>prior filings and answers\n    A-->>F: answer (may skip tool calls if<br/>context already sufficient)\n    F-->>B: SSE token stream + done"},{"language":"bash","snippet":"./scripts/deploy.sh"},{"language":"json","snippet":"{ \"message\": \"What was Apple's revenue in 2023?\", \"session_id\": \"optional-uuid\" }"},{"language":"text","snippet":"python tests/simulation_tests.py"},{"language":"text","snippet":"python tests/eval.py"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[],"languages":["python"],"docsSourceLabel":"GITHUB REPOS","editorialOverview":"Manual Anthropic tool-use agent over SEC EDGAR 10-K filings — no LangChain, no CrewAI. Tool calls and tokens stream live via SSE; NVIDIA NIM works as a drop-in provider. FastAPI + React. EDGAR Agent — Manual Agent Loop · FastAPI · React · Anthropic / NVIDIA NIM Full-stack AI agent that answers questions about public companies by fetching SEC EDGAR 10-K filings on demand. The agent loop is implemented manually — no LangChain, no CrewAI — using the Anthropic tool-use API or NVIDIA NIM's OpenAI-compatible function-calling interface. Responses stream token-by-token via SSE; tool calls are surfaced live i","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":398,"uniquenessScore":65,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T11:16:34.383Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:14:13.442Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/github_repos","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}