Skip to main content

Overview

The Agent class (aliased as RAGAgent) is the primary interface for the Finance Agent system. It provides a unified agent that handles RAG-based question answering across earnings transcripts, 10-K filings, and news.

Class Reference

Agent

Agent is an alias for RAGAgent, providing backward compatibility while serving as the main entry point.
from agent import Agent

# Create an agent instance
agent = Agent(openai_api_key="your-api-key")

AgentSystem

AgentSystem is another alias for RAGAgent, providing flexibility in naming conventions.
from agent import AgentSystem

# Create an agent instance
agent = AgentSystem(openai_api_key="your-api-key")

Factory Function

create_agent()

Factory function to create a new RAGAgent instance.
from agent import create_agent

# Create agent using factory
agent = create_agent()
return
RAGAgent
Returns a new RAGAgent instance

Module Exports

The agent module exports the following:
  • Agent - Main agent class (alias for RAGAgent)
  • RAGAgent - Core RAG agent implementation
  • AgentSystem - Alternative alias for RAGAgent
  • create_agent - Factory function
  • prompts - Centralized prompts module

Architecture

The Agent provides:

RAG-Based Q&A

Vector and keyword search across earnings transcripts, 10-K filings, and news

Stock Screening

Fundamental data filtering and analysis

Self-Improvement

Iterative refinement with quality evaluation

Multi-Source

Unified access to transcripts, SEC filings, and news

Usage Example

from agent import Agent
import os

# Initialize the agent
agent = Agent(openai_api_key=os.getenv("OPENAI_API_KEY"))

# Set database connection (optional)
agent.set_database_connection(db_connection)

# The agent is now ready to process questions
# See RAGAgent documentation for detailed usage

RAGAgent

Detailed RAG agent implementation

SearchEngine

Search operations and hybrid search

Build docs developers (and LLMs) love