sec-edgar-agentkit-smolagents


Namesec-edgar-agentkit-smolagents JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarySEC EDGAR agentkit for Hugging Face smolagents framework
upload_time2025-08-10 20:51:00
maintainerNone
docs_urlNone
authorStefano Amorelli
requires_python<4.0,>=3.8
licenseAGPL-3.0
keywords sec edgar smolagents huggingface agent financial
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SEC EDGAR agentkit for smolagents

A lightweight integration of SEC EDGAR data access tools for Hugging Face's [smolagents](https://github.com/huggingface/smolagents) framework.

## Installation

```bash
pip install sec-edgar-agentkit-smolagents
# or
pip install -r requirements.txt
```

## Quick Start

```python
from sec_edgar_smolagents import create_sec_edgar_agent

# Create an agent with all SEC EDGAR tools
agent = create_sec_edgar_agent("gpt-4")

# Ask questions about companies and filings
result = agent.run("What was Apple's revenue last year?")
print(result)
```

## Available Tools

- `CIKLookupTool` - Look up company CIK by name or ticker
- `CompanyInfoTool` - Get detailed company information
- `CompanyFactsTool` - Retrieve XBRL company facts
- `FilingSearchTool` - Search for SEC filings
- `FilingContentTool` - Extract filing content
- `Analyze8KTool` - Analyze 8-K material events
- `FinancialStatementsTool` - Extract financial statements
- `XBRLParseTool` - Parse XBRL data
- `InsiderTradingTool` - Analyze Forms 3/4/5

## Usage Examples

### Basic Company Research

```python
from sec_edgar_smolagents import create_sec_edgar_agent

agent = create_sec_edgar_agent("gpt-4")

# Simple queries
agent.run("Find Microsoft's latest 10-K filing")
agent.run("What were Tesla's material events in the last quarter?")
agent.run("Show me insider trading activity for Apple")
```

### Using Specific Tools

```python
from sec_edgar_smolagents import CIKLookupTool, FilingSearchTool

# Create agent with only specific tools
agent = create_sec_edgar_agent(
    "gpt-4",
    tools=[CIKLookupTool(), FilingSearchTool()]
)

result = agent.run("Find Amazon's CIK and recent filings")
```

### Different Model Providers

```python
# OpenAI
agent = create_sec_edgar_agent("gpt-4")

# Anthropic
agent = create_sec_edgar_agent("claude-3-opus-20240229")

# Hugging Face API
from smolagents import HfApiModel
model = HfApiModel("meta-llama/Llama-3-8b-instruct")
agent = create_sec_edgar_agent(model)

# Local model
from smolagents import TransformersModel
model = TransformersModel("microsoft/Phi-3-mini-4k-instruct")
agent = create_sec_edgar_agent(model)
```

### Financial Analysis

```python
agent = create_sec_edgar_agent("gpt-4")

# Complex multi-step analysis
analysis = agent.run("""
    1. Find Apple's last 3 years of 10-K filings
    2. Extract revenue and net income from each
    3. Calculate year-over-year growth rates
    4. Compare with Microsoft's performance
""")

print(analysis)
```

## MCP Server Configuration

The tools connect to the `sec-edgar-mcp` server. By default, it looks for the server at the `sec-edgar-mcp` command. You can customize this:

```python
from sec_edgar_smolagents import SECEdgarToolkit
from sec_edgar_smolagents.mcp_client import MCPClient

# Custom MCP server command
client = MCPClient(server_command="/path/to/sec-edgar-mcp")
toolkit = SECEdgarToolkit(mcp_client=client)

agent = create_sec_edgar_agent("gpt-4", tools=toolkit.get_tools())
```

## Development

### Running Tests

```bash
pytest integrations/smolagents/__tests__/
```

### Running Examples

```bash
cd integrations/smolagents
python examples/basic_usage.py
python examples/financial_analysis.py
```

## Requirements

- Python 3.8+
- smolagents >= 0.1.0
- sec-edgar-mcp server installed (`pip install sec-edgar-mcp`)

## License

AGPL-3.0 - See [LICENSE](../../LICENSE) for details.

## Author

Stefano Amorelli <stefano@amorelli.tech>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sec-edgar-agentkit-smolagents",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "sec, edgar, smolagents, huggingface, agent, financial",
    "author": "Stefano Amorelli",
    "author_email": "stefano@amorelli.tech",
    "download_url": "https://files.pythonhosted.org/packages/08/52/a19b665d4565b7abc8b9f93b018e6af17f0973305de2b403788d7a1130f5/sec_edgar_agentkit_smolagents-0.1.0.tar.gz",
    "platform": null,
    "description": "# SEC EDGAR agentkit for smolagents\n\nA lightweight integration of SEC EDGAR data access tools for Hugging Face's [smolagents](https://github.com/huggingface/smolagents) framework.\n\n## Installation\n\n```bash\npip install sec-edgar-agentkit-smolagents\n# or\npip install -r requirements.txt\n```\n\n## Quick Start\n\n```python\nfrom sec_edgar_smolagents import create_sec_edgar_agent\n\n# Create an agent with all SEC EDGAR tools\nagent = create_sec_edgar_agent(\"gpt-4\")\n\n# Ask questions about companies and filings\nresult = agent.run(\"What was Apple's revenue last year?\")\nprint(result)\n```\n\n## Available Tools\n\n- `CIKLookupTool` - Look up company CIK by name or ticker\n- `CompanyInfoTool` - Get detailed company information\n- `CompanyFactsTool` - Retrieve XBRL company facts\n- `FilingSearchTool` - Search for SEC filings\n- `FilingContentTool` - Extract filing content\n- `Analyze8KTool` - Analyze 8-K material events\n- `FinancialStatementsTool` - Extract financial statements\n- `XBRLParseTool` - Parse XBRL data\n- `InsiderTradingTool` - Analyze Forms 3/4/5\n\n## Usage Examples\n\n### Basic Company Research\n\n```python\nfrom sec_edgar_smolagents import create_sec_edgar_agent\n\nagent = create_sec_edgar_agent(\"gpt-4\")\n\n# Simple queries\nagent.run(\"Find Microsoft's latest 10-K filing\")\nagent.run(\"What were Tesla's material events in the last quarter?\")\nagent.run(\"Show me insider trading activity for Apple\")\n```\n\n### Using Specific Tools\n\n```python\nfrom sec_edgar_smolagents import CIKLookupTool, FilingSearchTool\n\n# Create agent with only specific tools\nagent = create_sec_edgar_agent(\n    \"gpt-4\",\n    tools=[CIKLookupTool(), FilingSearchTool()]\n)\n\nresult = agent.run(\"Find Amazon's CIK and recent filings\")\n```\n\n### Different Model Providers\n\n```python\n# OpenAI\nagent = create_sec_edgar_agent(\"gpt-4\")\n\n# Anthropic\nagent = create_sec_edgar_agent(\"claude-3-opus-20240229\")\n\n# Hugging Face API\nfrom smolagents import HfApiModel\nmodel = HfApiModel(\"meta-llama/Llama-3-8b-instruct\")\nagent = create_sec_edgar_agent(model)\n\n# Local model\nfrom smolagents import TransformersModel\nmodel = TransformersModel(\"microsoft/Phi-3-mini-4k-instruct\")\nagent = create_sec_edgar_agent(model)\n```\n\n### Financial Analysis\n\n```python\nagent = create_sec_edgar_agent(\"gpt-4\")\n\n# Complex multi-step analysis\nanalysis = agent.run(\"\"\"\n    1. Find Apple's last 3 years of 10-K filings\n    2. Extract revenue and net income from each\n    3. Calculate year-over-year growth rates\n    4. Compare with Microsoft's performance\n\"\"\")\n\nprint(analysis)\n```\n\n## MCP Server Configuration\n\nThe tools connect to the `sec-edgar-mcp` server. By default, it looks for the server at the `sec-edgar-mcp` command. You can customize this:\n\n```python\nfrom sec_edgar_smolagents import SECEdgarToolkit\nfrom sec_edgar_smolagents.mcp_client import MCPClient\n\n# Custom MCP server command\nclient = MCPClient(server_command=\"/path/to/sec-edgar-mcp\")\ntoolkit = SECEdgarToolkit(mcp_client=client)\n\nagent = create_sec_edgar_agent(\"gpt-4\", tools=toolkit.get_tools())\n```\n\n## Development\n\n### Running Tests\n\n```bash\npytest integrations/smolagents/__tests__/\n```\n\n### Running Examples\n\n```bash\ncd integrations/smolagents\npython examples/basic_usage.py\npython examples/financial_analysis.py\n```\n\n## Requirements\n\n- Python 3.8+\n- smolagents >= 0.1.0\n- sec-edgar-mcp server installed (`pip install sec-edgar-mcp`)\n\n## License\n\nAGPL-3.0 - See [LICENSE](../../LICENSE) for details.\n\n## Author\n\nStefano Amorelli <stefano@amorelli.tech>\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "SEC EDGAR agentkit for Hugging Face smolagents framework",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/stefanoamorelli/sec-edgar-agentkit",
        "Repository": "https://github.com/stefanoamorelli/sec-edgar-agentkit"
    },
    "split_keywords": [
        "sec",
        " edgar",
        " smolagents",
        " huggingface",
        " agent",
        " financial"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1036ff4c1b4ee2a1cdbeb878621887a4fa399c0d3b9c92b49f8a8b1cf96de528",
                "md5": "d80c539538732e6f5c142d4d0c705d92",
                "sha256": "58473b9833e3a8a846d15bcb33babd30aa7accac30a27be0b1dda6258b961627"
            },
            "downloads": -1,
            "filename": "sec_edgar_agentkit_smolagents-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d80c539538732e6f5c142d4d0c705d92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 8239,
            "upload_time": "2025-08-10T20:50:59",
            "upload_time_iso_8601": "2025-08-10T20:50:59.010771Z",
            "url": "https://files.pythonhosted.org/packages/10/36/ff4c1b4ee2a1cdbeb878621887a4fa399c0d3b9c92b49f8a8b1cf96de528/sec_edgar_agentkit_smolagents-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0852a19b665d4565b7abc8b9f93b018e6af17f0973305de2b403788d7a1130f5",
                "md5": "9b7eac52c1d7889d349e5d0fb95bb101",
                "sha256": "b21c4ad84fa025267d58399801a5422f939487fa9f5a6ee443de33a9a08637aa"
            },
            "downloads": -1,
            "filename": "sec_edgar_agentkit_smolagents-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9b7eac52c1d7889d349e5d0fb95bb101",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 6337,
            "upload_time": "2025-08-10T20:51:00",
            "upload_time_iso_8601": "2025-08-10T20:51:00.539833Z",
            "url": "https://files.pythonhosted.org/packages/08/52/a19b665d4565b7abc8b9f93b018e6af17f0973305de2b403788d7a1130f5/sec_edgar_agentkit_smolagents-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-10 20:51:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stefanoamorelli",
    "github_project": "sec-edgar-agentkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sec-edgar-agentkit-smolagents"
}
        
Elapsed time: 0.48889s