SEC Copilot is an LLM-powered chatbot that retrieves financial reports from the SEC EDGAR database, and earnings call transcripts from the Discounting Cash Flows API allowing users to ask questions, summarize details, and gain insights from financial data.
- Fetch financial reports from the SEC EDGAR database
- Fetch earnings call transcripts from the Discounting Cash Flows API
- Ask questions about specific companies or financial metrics
- Summarize key details from financial reports
- Python 3.9 or higher
The application and development environment have been tested on Linux and macOS. While Unix systems are supported in principle, they have not been explicitly tested.
- Linux
- macOS
- Unix (untested)
Tip
If you'd like to run this on a Windows machine, I suggest setting up WSL with the documention here.
-
Clone the repository:
git clone https://github.com/gsornsen/secbot.git cd secbot
-
Set up the environment:
make env
This command will:
- Install uv if not already present
- Create a virtual environment
- Install project dependencies
- Set up pre-commit hooks
-
Create a
.env
file in the project root and add your OpenAI API key:OPEN_AI_TOKEN=your_api_key_here
-
Add your DMC API key to the
.env
file:DMC_API_KEY=your_api_key_here
-
Create a JWT secret for Chainlit authentication:
uv run chainlit create-secret
Add the generated secret to your
.env
file:CHAINLIT_AUTH_SECRET=your_generated_secret_here
-
Add OAuth keys to your
.env
file:OAUTH_GITHUB_CLIENT_ID=your_github_client_id OAUTH_GITHUB_CLIENT_SECRET=your_github_client_secret OAUTH_GOOGLE_CLIENT_ID=your_google_client_id OAUTH_GOOGLE_CLIENT_SECRET=your_google_client_secret
For more details on setting up authentication, refer to the Chainlit Authentication Documentation.
To run the application:
make run
To run the test suite:
make test
This project uses several tools to maintain code quality and consistency:
-
uv: A fast Python package installer and resolver. It's used instead of pip for faster dependency management.
-
Ruff: A fast Python linter and formatter. It's configured to run automatically on pre-commit.
-
Pre-commit hooks: Automatically run before each commit to ensure code quality. They include:
- Ruff for linting and formatting
- Pytest for running tests before pushing changes
To manually run pre-commit hooks:
pre-commit run --all-files
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for providing the language model capabilities
- SEC for making financial data accessible