Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Financial analysis agent with stock price, company info, and historical data tools.
Simple
Agents: 1 — Single agent with finance tools for comprehensive stock analysis.
Workflow
- Receive stock query
- Fetch real-time price data
- Retrieve company information
- Analyze historical trends
Setup
pip install praisonaiagents praisonai yfinance
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent
from praisonaiagents import get_stock_price, get_stock_info, get_historical_data
agent = Agent(
name="FinanceAnalyst",
instructions="You are a financial analyst. Analyze stocks and provide insights.",
tools=[get_stock_price, get_stock_info, get_historical_data]
)
result = agent.start("Analyze Apple (AAPL) stock - current price and 6-month trend")
print(result)
Run — CLI
praisonai "Analyze Tesla stock performance" --tools yfinance
Run — agents.yaml
framework: praisonai
topic: Stock Analysis
roles:
finance_analyst:
role: Financial Analyst
goal: Analyze stocks and provide investment insights
backstory: You are an expert financial analyst
tools:
- get_stock_price
- get_stock_info
- get_historical_data
tasks:
analyze_stock:
description: Analyze Apple (AAPL) stock - current price and 6-month trend
expected_output: A comprehensive stock analysis
Serve API
from praisonaiagents import Agent
from praisonaiagents import get_stock_price, get_stock_info, get_historical_data
agent = Agent(
name="FinanceAnalyst",
instructions="You are a financial analyst.",
tools=[get_stock_price, get_stock_info, get_historical_data]
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Compare AAPL and GOOGL stocks"}'
Advanced Workflow (All Features)
Agents: 1 — Single agent with memory, persistence, structured output, and session resumability.
Workflow
- Initialize session for portfolio tracking
- Configure SQLite persistence for analysis history
- Execute multi-tool analysis with structured output
- Store results in memory for trend comparison
- Resume session for ongoing portfolio monitoring
Setup
pip install praisonaiagents praisonai yfinance pydantic
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent, Task, AgentTeam, Session
from praisonaiagents import get_stock_price, get_stock_info, get_historical_data
from pydantic import BaseModel
# Structured output schema
class StockAnalysis(BaseModel):
symbol: str
current_price: float
recommendation: str
key_metrics: list[str]
risk_factors: list[str]
# Create session for portfolio tracking
session = Session(session_id="portfolio-001", user_id="user-1")
# Agent with memory and tools
agent = Agent(
name="FinanceAnalyst",
instructions="Analyze stocks and return structured investment reports.",
tools=[get_stock_price, get_stock_info, get_historical_data],
memory=True
)
# Task with structured output
task = Task(
description="Analyze Apple (AAPL) stock with buy/sell recommendation",
expected_output="Structured stock analysis",
agent=agent,
output_pydantic=StockAnalysis
)
# Run with SQLite persistence
agents = AgentTeam(
agents=[agent],
tasks=[task],
memory=True
)
result = agents.start()
print(result)
# Resume later for portfolio review
session2 = Session(session_id="portfolio-001", user_id="user-1")
history = session2.search_memory("AAPL")
Run — CLI
praisonai "Analyze AAPL stock" --tools yfinance --memory --verbose
Run — agents.yaml
framework: praisonai
topic: Stock Analysis
memory: true
memory_config:
provider: sqlite
db_path: finance.db
roles:
finance_analyst:
role: Financial Analyst
goal: Analyze stocks with structured output
backstory: You are an expert financial analyst
tools:
- get_stock_price
- get_stock_info
- get_historical_data
memory: true
tasks:
analyze_stock:
description: Analyze Apple (AAPL) stock with buy/sell recommendation
expected_output: Structured stock analysis
output_json:
symbol: string
current_price: number
recommendation: string
key_metrics: array
risk_factors: array
praisonai agents.yaml --verbose
Serve API
from praisonaiagents import Agent
from praisonaiagents import get_stock_price, get_stock_info, get_historical_data
agent = Agent(
name="FinanceAnalyst",
instructions="Analyze stocks and return structured reports.",
tools=[get_stock_price, get_stock_info, get_historical_data],
memory=True
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Analyze TSLA", "session_id": "portfolio-001"}'
Monitor / Verify
praisonai "test finance" --tools yfinance --verbose
Cleanup
Features Demonstrated
| Feature | Implementation |
|---|
| Workflow | Multi-tool stock analysis |
| DB Persistence | SQLite via memory_config |
| Observability | --verbose flag |
| Tools | yfinance (price, info, history) |
| Resumability | Session with session_id |
| Structured Output | Pydantic StockAnalysis model |
Next Steps