AI agents and tools for the retail investor
Project description
๐ค Navam Invest
AI-Powered Investment Advisor for Retail Investors
Features โข Quick Start โข Agents โข Workflows โข Examples โข Documentation
๐ What's New in v0.1.16
Multi-Agent Workflows - Coordinated agent collaboration for comprehensive analysis:
- โจ Investment Analysis Workflow: Sequential orchestration of Quill (fundamental) โ Macro Lens (macro timing) โ Synthesis
- โจ
/analyze <SYMBOL>Command: One command delivers institutional-grade analysis combining bottom-up and top-down perspectives - โจ Shared State Architecture: Agents reference each other's analysis for coherent recommendations
- โจ Real-Time Multi-Agent Streaming: Watch agents collaborate in real-time with transparent tool usage
- โจ First Multi-Agent Workflow: Foundation for future workflows (tax optimization, portfolio rebalancing, screening)
Example: /analyze AAPL โ Quill analyzes fundamentals โ Macro Lens validates timing โ Synthesis delivers BUY/HOLD/SELL with confidence
See Release Notes for details | Previous: v0.1.15 - Macro Lens
๐ Overview
navam-invest brings institutional-grade portfolio intelligence to individual retail investors. Built with LangGraph and powered by Anthropic's Claude, it provides specialized AI agents that collaborate through multi-agent workflows for equity research, systematic screening, macro analysis, portfolio management, and market researchโall accessible through an interactive terminal interface.
Why Navam Invest?
- ๐ฏ Multi-Agent Workflows: Coordinated agent collaboration for comprehensive analysis (NEW in v0.1.16)
- ๐ค Specialized Agents: Purpose-built agents for equity research, screening, macro strategy, portfolio analysis, and market research
- ๐ Privacy-First: Run locally with your own API keysโyour data stays yours
- ๐ก Transparent: Full audit trails and explainable AI reasoning with real-time streaming
- ๐ Free Data Sources: Leverages high-quality public APIs (free tiers available)
- ๐ง Extensible: Modular architecture makes it easy to add new agents and workflows
โจ Features
๐ Multi-Agent Workflows (NEW in v0.1.16)
Coordinated agent collaboration that combines specialized expertise for comprehensive analysis:
Investment Analysis WorkflowSequential Orchestration: Quill โ Macro Lens โ Synthesis How it works:
Command: Example:
Benefits:
|
๐ค Specialized AI Agents (Powered by LangGraph)
Quill - Equity ResearchDeep fundamental analysis & thesis building
Command: Use Case: "Analyze AAPL and provide an investment thesis with fair value" |
Screen Forge - Equity ScreeningSystematic stock discovery & idea generation
Command: Use Case: "Screen for value stocks with P/E < 15 and market cap > $1B" |
Macro Lens - Market StrategistTop-down macro analysis & regime identification
Command: Use Case: "What's the current macro regime and which sectors should I overweight?" |
Portfolio Analysis (Legacy)Comprehensive portfolio tools
Command: Use Case: "What's the current price and fundamentals of MSFT?" |
Market Research (Legacy)Top-down macro analysis
Command: Use Case: "Show me the Treasury yield curve and economic indicators" Note: Will be phased out in favor of Macro Lens agent in v0.2.0 |
|
๐ Real API Integrations (27 Tools Across 8 Data Sources)
| API | Tools | Purpose | Free Tier |
|---|---|---|---|
| Alpha Vantage | 2 | Stock prices, company overviews | 25-500 calls/day |
| Financial Modeling Prep | 4 | Financial statements, ratios, screening | 250 calls/day |
| Tiingo | 4 | Historical fundamentals (5yr), quarterly data | 50 symbols/hr |
| Finnhub | 5 | News/social/insider sentiment, analyst ratings | 60 calls/min |
| FRED (St. Louis Fed) | 2 | Economic indicators, macro data | Unlimited |
| U.S. Treasury | 4 | Yield curves, treasury rates | Unlimited |
| SEC EDGAR | 5 | Corporate filings (10-K, 10-Q, 13F) | 10 req/sec |
| NewsAPI.org | 3 | Market news, headlines | 100 calls/day |
| Anthropic Claude | - | AI reasoning (Sonnet 4.5) | Pay-as-you-go |
๐ฌ Interactive Terminal UI
- Chat Interface: Natural language interaction with specialized agents
- Real-time Streaming: Watch agents think and reason live
- Multi-Agent Progress: See workflow transitions and agent collaboration
- Granular Tool Tracking: Watch which tools are called with what arguments
- Markdown Rendering: Beautiful formatted output with tables
- Agent Switching:
/quill,/screen,/macro,/portfolio,/research - Workflow Commands:
/analyze <SYMBOL>for multi-agent analysis - Command Palette: Quick access to common actions
- File Reading: Analyze local portfolio files
๐๏ธ Built on Modern Tech
LangGraph (Multi-Agent Orchestration) โ LangChain (Tools) โ Anthropic Claude (Reasoning)
โ
Textual (Terminal UI) + Typer (CLI) + httpx (Async HTTP)
Architecture Highlights:
- Multi-Agent Workflows: Sequential orchestration with shared state (NEW)
- Specialized Agents: Purpose-built agents with focused tool sets
- Tools Registry: Agent-specific tool mappings for optimal performance
- ReAct Pattern: Reasoning + Acting for transparent decision-making
- Async/Await: Non-blocking I/O for responsive UI
- Type Safety: Full type hints with MyPy strict mode
๐ Quick Start
Prerequisites
- Python 3.9+ (3.13 recommended)
- pip package manager
- API keys (see Configuration)
Installation
Option 1: Install from PyPI (Recommended)
pip install navam-invest
Option 2: Install from Source
git clone https://github.com/navam-io/navam-invest.git
cd navam-invest
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
Configuration
-
Copy environment template:
cp .env.example .env
-
Add your API keys to
.env:# Required ANTHROPIC_API_KEY=sk-ant-... # Optional (but recommended for full functionality) ALPHA_VANTAGE_API_KEY=your_key_here FMP_API_KEY=your_key_here TIINGO_API_KEY=your_key_here FINNHUB_API_KEY=your_key_here FRED_API_KEY=your_key_here NEWSAPI_API_KEY=your_key_here
-
Get API Keys (all have free tiers):
Service Link Free Tier Anthropic โญ console.anthropic.com Pay-as-you-go ($3-15/M tokens) Alpha Vantage alphavantage.co/support/#api-key 25 calls/day FMP financialmodelingprep.com/developer 250 calls/day Tiingo tiingo.com 50 symbols/hr, 5yr history Finnhub finnhub.io/register 60 calls/min FRED fredaccount.stlouisfed.org/apikeys Unlimited NewsAPI newsapi.org/register 100 calls/day Treasury & SEC - No keys required!
Usage
Launch the Interactive Interface
navam invest
This opens an interactive chat interface with 5 specialized AI agents and multi-agent workflows.
Quick Command Reference
| Command | Agent/Workflow | Description |
|---|---|---|
/analyze <SYMBOL> ๐ |
Investment Analysis Workflow | Multi-agent fundamental + macro analysis |
/quill |
Quill (Equity Research) | Deep fundamental analysis & thesis building |
/screen |
Screen Forge | Systematic stock screening & idea generation |
/macro |
Macro Lens | Top-down macro analysis & regime identification |
/portfolio |
Portfolio Analysis | Comprehensive stock & portfolio tools |
/research |
Market Research | Macroeconomic analysis & treasury data (legacy) |
/examples |
- | Show example queries for current agent/workflow |
/help |
- | Show all commands |
/clear |
- | Clear chat history |
/quit |
- | Exit application |
๐ก Example Interactions
Multi-Agent Workflow: Investment Analysis ๐
๐ Complete Investment Analysis (Fundamental + Macro)
You: /analyze MSFT
Investment Analysis Workflow: Starting multi-agent analysis...
๐ Quill analyzing fundamentals...
โ get_company_fundamentals
โ get_financial_ratios
โ get_historical_fundamentals
โ get_dcf_valuation
โ Fundamental analysis complete
๐ Macro Lens validating timing...
โ get_key_macro_indicators
โ get_treasury_yield_curve
โ search_market_news
โ Macro validation complete
๐ฏ Synthesizing recommendation...
Final Recommendation:
**Overall Rating: BUY - Medium Confidence**
**Key Reasoning**:
Microsoft demonstrates exceptional fundamental quality with 42% ROE,
$87B annual free cash flow, and strong competitive moats in cloud
(Azure) and enterprise software. Current valuation of 31x P/E is
reasonable given 15% revenue growth and expanding margins. However,
macro timing presents headwindsโwe're in late expansion phase with
inverted yield curve signaling recession risk within 12 months. Tech
sector typically underperforms in early recession as enterprise IT
spending contracts.
**Suggested Action**:
Consider accumulating MSFT on dips rather than full position immediately.
Dollar-cost average over 3-6 months to capture potential volatility from
macro headwinds. Microsoft's defensive characteristics (enterprise
subscriptions, cloud infrastructure) should outperform cyclical tech
peers in downturn.
**Risk Warning**:
Monitor enterprise cloud spending trends and Microsoft Azure growth rates.
If Azure growth decelerates below 25% YoY, fundamental thesis weakens.
Macro risk: Recession could compress P/E multiple to 24-26x (historical
trough), implying 15-20% downside risk from current levels.
**Data Sources**:
- Fundamentals: Tiingo (5-year history), FMP (financial ratios)
- Macro: FRED (GDP, CPI, unemployment), U.S. Treasury (yield curve)
- Valuation: DCF model with 10% WACC, 3% terminal growth
---
**Quill's Fundamental Analysis** (Bottom-Up):
**Business Quality: Excellent**
- Market leader in cloud infrastructure (Azure: #2 globally, 23% market share)
- Dominant enterprise software franchise (Office 365, Windows, LinkedIn)
- Emerging AI leadership (OpenAI partnership, Copilot integration)
- Exceptional competitive moats: switching costs, network effects, scale
**Financial Health** (5-Year Trends):
- Revenue Growth: 14% CAGR (FY19-FY24) โ Consistent, accelerating
- Operating Margin: 37% โ 43% (600bps expansion) โ World-class
- Free Cash Flow: $52B โ $87B (+68%) โ Capital allocation strength
- ROE: 38% โ 42% โ Best-in-class capital efficiency
- Debt-to-Equity: 0.34 โ Conservative, AA+ credit rating
**Valuation Assessment**:
- Current P/E: 31x (vs. 5-year avg: 28x) โ Slight premium
- P/FCF: 28x โ Reasonable given quality and growth
- DCF Fair Value: $425 (current: $410) โ **3.7% upside**
- Price-to-Sales: 12x โ Premium to peers, justified by margins
**Investment Thesis**:
Microsoft is a **quality growth compounder** with secular tailwinds in
cloud and AI. The business demonstrates pricing power, margin expansion,
and capital-light growth. At current valuation, shares are fairly valued
with modest upside to DCF fair value.
**Bull Case** (Upside to $480, +17%):
- Azure accelerates to 30%+ growth (AI workloads)
- Copilot drives $10B+ incremental revenue by FY26
- Operating margin expands to 45% (cloud scale economics)
- Multiple re-rates to 35x on AI leadership
**Bear Case** (Downside to $320, -22%):
- Recession reduces enterprise IT spending
- Azure growth decelerates to sub-20% (competitive pressure)
- AI monetization disappoints (adoption lag)
- Multiple compresses to 24x (historical trough)
**Catalysts** (Next 12 months):
- โ
Q1 FY25 earnings (Oct 2024): Azure growth trajectory
- โ
Copilot adoption metrics (Dec 2024): AI revenue inflection
- โ
OpenAI GPT-5 release (2025): Technology leadership
- โ ๏ธ Macro slowdown: Defensive cloud spending holds up better
**Recommendation**: BUY on dips below $390 (26x P/E, 8% discount to fair value)
---
**Macro Lens's Timing Validation** (Top-Down):
**Current Macro Regime: Late Expansion (Peak Phase)**
**Supporting Macro Data**:
- GDP Growth: 2.4% (Q3 2024) โ Slowing trend
- Unemployment: 3.9% โ Near cycle lows
- CPI Inflation: 3.2% YoY โ Sticky above target
- Fed Funds Rate: 5.25-5.50% โ Restrictive territory
- 10Y-2Y Yield Spread: **-0.54% (INVERTED)** โ Recession warning
- Inversion Duration: 16 months โ In danger zone (12-18mo lead time)
**Sector Positioning**:
Technology sector in late expansion phase shows:
- โ **Underperform in early recession** (cyclical earnings)
- โ ๏ธ **Valuation vulnerability** (P/E compression risk)
- โ
**Microsoft = Defensive tech** (enterprise subscriptions, sticky revenue)
**Timing Assessment**:
**Macro Headwinds**:
1. **Inverted Yield Curve**: 16 months into inversion suggests recession
risk elevated for H1 2025. Tech multiples typically compress 20-30%
in recession.
2. **Late Cycle Dynamics**: Corporate IT spending growth decelerates in
late expansion as CFOs turn cautious.
3. **Valuation Risk**: Tech sector trading at 27x P/E (vs. 15x S&P 500)
leaves room for multiple compression.
**Macro Tailwinds**:
1. **Defensive Characteristics**: Microsoft's enterprise subscription
model (90%+ recurring revenue) more resilient than cyclical tech.
2. **Cloud Infrastructure**: Mission-critical workloads (Azure, Office 365)
see lower churn in recession vs. discretionary tech spending.
3. **Fed Rate Cuts**: If Fed pivots in 2025, growth stocks benefit from
lower discount rates (duration play).
**Recommendation**: โ ๏ธ **Proceed with Caution - Dollar-Cost Average**
Fundamentals are excellent, but macro timing is challenging. Given inverted
yield curve and late-cycle positioning, recommend building position gradually
over 3-6 months rather than full commitment today. If recession materializes,
expect 15-20% drawdown opportunity to add at better valuations.
**Macro Risks to Monitor**:
- Yield curve steepening (recession trigger within 3-6 months)
- Enterprise software spending indicators (Salesforce, ServiceNow guidance)
- Azure growth deceleration below 25% (cyclical headwind confirmation)
- Credit spread widening (corporate stress)
**Ideal Entry**: Wait for macro capitulation (10-15% market correction) or
accumulate on any dip below $380 (24x P/E, 30% margin of safety vs. fair value).
๐ฏ Quick Analysis with Confidence Levels
You: /analyze NVDA
Investment Analysis Workflow: Starting multi-agent analysis...
๐ Quill analyzing fundamentals...
๐ Macro Lens validating timing...
๐ฏ Synthesizing recommendation...
Final Recommendation:
**Overall Rating: HOLD - Low Confidence**
**Key Reasoning**:
NVIDIA shows exceptional fundamental strength (AI leadership, 100%+ revenue
growth, 75% gross margins) but faces extreme valuation risk (65x P/E,
40x FY25E) and unfavorable macro timing. Late-cycle regime with recession
risk makes high-multiple growth stocks vulnerable to 30-50% drawdowns.
Wait for better entry point.
**Suggested Action**:
Current holders: Trim position, take profits. New buyers: Wait for correction
to $90-100 range (40-45x FY25E) before initiating. Consider stop-loss at $110
(-15%) to protect against macro-driven selloff.
**Risk Warning**:
AI hype cycle could deflate quickly if enterprise AI spending disappoints.
Recession would trigger P/E de-rating from 65x to 35-40x (historical growth
stock trough), implying 40-50% downside risk. Monitor data center capex
trends from hyperscalers (Microsoft, Google, Amazon).
Macro Lens - Market Strategist Agent
๐ Economic Regime Analysis & Sector Guidance
You: /macro
You: What's the current macro regime? Are we in expansion, peak, or recession?
Macro Lens (Market Strategist):
โ Calling get_key_macro_indicators()
โ get_key_macro_indicators completed
โ Calling get_treasury_yield_curve()
โ get_treasury_yield_curve completed
โ Calling get_economic_indicator(series_id=UNRATE)
โ get_economic_indicator completed
**Current Macro Regime Assessment**
**Regime: Late Expansion (Peak Phase)**
**Supporting Indicators**:
- **GDP Growth**: 2.4% (Q3 2024) - Slowing from 3.2% in Q2, below trend
- **Unemployment**: 3.9% - Near multi-decade lows, tight labor market
- **Inflation (CPI)**: 3.2% YoY - Above Fed target, persistent services inflation
- **Fed Funds Rate**: 5.25-5.50% - Restrictive territory, likely at terminal rate
- **Yield Curve**: **Inverted** (10Y-2Y spread: -0.54%)
- Classic recession warning signal
- Historically precedes recession by 12-18 months
- Currently 16 months into inversion
**Yield Curve Interpretation**:
The inverted yield curve (short rates > long rates) indicates market expectations
of Fed rate cuts due to economic slowdown. This is a highly reliable recession
indicator with a 12-18 month lead time. We're now 16 months into the inversion,
suggesting recession risk elevated for H1 2025.
**Sector Allocation Guidance**:
**Overweight** (Late Cycle/Defensive):
- โ
**Energy** - Persistent inflation, geopolitical premium, strong FCF
- โ
**Healthcare** - Defensive earnings, demographic tailwinds, low cyclicality
- โ
**Utilities** - Recession hedge, stable dividends, rate cut beneficiary
- โ
**Consumer Staples** - Defensive spending, pricing power intact
**Underweight** (Cyclical/Growth):
- โ **Technology** - Valuation risk, vulnerable to earnings downgrades
- โ **Consumer Discretionary** - Weakening consumer, high debt levels
- โ **Financials** - Credit cycle turning, recession = loan losses
**Factor Recommendations**:
**Favor**:
- **Quality** (high ROE, low debt) - Resilience in downturn
- **Low Volatility** - Defensive positioning
- **Value** - Lower downside in bear market, reasonable valuations
- **Large Cap** - Flight to safety in risk-off environment
**Avoid**:
- **Growth** - High valuations vulnerable to multiple compression
- **Small Cap** - Liquidity risk, credit stress, recession sensitivity
- **High Beta** - Amplified drawdowns in market sell-off
**Key Risks to Monitor** (Next 6 Months):
1. **Recession Timing**: Yield curve un-inversion often marks recession start
2. **Fed Policy Error**: Holding rates too high = hard landing risk
3. **Credit Stress**: Corporate debt refinancing at higher rates
4. **Consumer Weakness**: Excess savings depleted, student loan restart
5. **Geopolitical Shocks**: Oil supply disruptions, trade tensions
**Investment Strategy Summary**:
Position defensively with quality, low-volatility stocks in healthcare, utilities,
and staples. Reduce cyclical and growth exposure. Build cash for opportunities
when recession arrives. Consider long-duration bonds (10Y+ treasuries) as
Fed cuts rates in 2025.
Quill - Equity Research Agent
๐ Investment Thesis with DCF Valuation
You: /quill
You: Analyze AAPL and provide an investment thesis with fair value
Quill (Equity Research):
โ Calling get_company_fundamentals(symbol=AAPL)
โ get_company_fundamentals completed
โ Calling get_financial_ratios(symbol=AAPL)
โ get_financial_ratios completed
โ Calling get_historical_fundamentals(symbol=AAPL, years=5)
โ get_historical_fundamentals completed
โ Calling get_dcf_valuation(symbol=AAPL)
โ get_dcf_valuation completed
**Investment Thesis: Apple Inc. (AAPL)**
**Business Overview**:
Apple is the world's most valuable technology company ($3.5T market cap),
operating a vertically integrated ecosystem spanning hardware (iPhone, Mac,
iPad), services (App Store, iCloud, Apple Music), and wearables (Apple Watch,
AirPods). The company's competitive moats include brand loyalty, ecosystem
lock-in, and premium positioning.
**Financial Health** (5-Year Analysis):
**Revenue Trends**:
- FY19: $260B โ FY24: $383B (8% CAGR)
- iPhone: 52% of revenue (stable), Services: 22% (growing 16% YoY)
- Geographic: Americas 42%, Greater China 19%, Europe 24%
**Profitability**:
- Gross Margin: 38% โ 46% (800bps expansion) - Industry-leading
- Operating Margin: 24% โ 30% - Best-in-class for hardware
- Net Margin: 21% โ 26% - Exceptional cash generation
- ROE: 49% โ 147% (buybacks amplifying returns)
**Cash Flow**:
- Operating Cash Flow: $69B โ $118B (+71%)
- Free Cash Flow: $58B โ $100B - Massive capital return capacity
- FCF Margin: 22% โ 26% - Among highest in mega-cap tech
**Balance Sheet**:
- Net Cash: $62B (vs. $137B gross cash, $75B debt)
- Debt-to-Equity: 1.8 โ Manageable, used for buybacks
- Current Ratio: 0.88 โ Efficient working capital management
**Valuation Assessment**:
**Current Metrics**:
- Price: $227 (as of analysis)
- P/E Ratio: 36x (TTM), 30x (FY25E)
- P/FCF: 27x - Premium valuation
- EV/EBITDA: 26x
- PEG Ratio: 3.0 (high for 10% growth)
**DCF Fair Value Calculation**:
- WACC: 9.5% (equity: 8%, debt: 3%, tax: 15%)
- Terminal Growth: 3% (GDP-like perpetuity)
- 5-Year FCF Forecast: $100B โ $130B (5% CAGR)
- **Intrinsic Value: $210 per share**
- **Current Price: $227 โ 8% overvalued**
**Investment Thesis**:
**Bull Case** (Price Target: $260, +15%):
- Services revenue inflection (Apple Vision Pro, subscriptions)
- iPhone upgrade supercycle (AI features, 5-year replacement)
- Gross margin expansion to 48% (services mix shift)
- $110B+ annual buybacks (6% yield at current price)
- Multiple sustains at 32-35x on quality premium
**Base Case** (Fair Value: $210, -7.5%):
- iPhone growth slows to 2-3% (market saturation)
- Services grow 12-15% (Apple One bundles)
- Margins stable at 45-46% (mix shift offsets inflation)
- FCF grows 6% annually (buybacks continue)
- P/E de-rates to 28x (normalized growth stock multiple)
**Bear Case** (Downside: $180, -21%):
- iPhone replacement cycle extends to 4+ years (saturation)
- China regulatory/competitive risks (Huawei resurgence)
- Services growth decelerates to sub-10% (market maturity)
- Margin compression from product mix shift to India (lower ASP)
- P/E compresses to 24x (market de-rating of mega-cap tech)
**Key Catalysts** (Next 12 months):
- โ
iPhone 16 cycle with AI features (Sep 2024)
- โ
Vision Pro international launch (2025)
- โ
India manufacturing scale-up (supply chain diversification)
- โ ๏ธ China economic slowdown (18% of revenue at risk)
- โ ๏ธ DOJ antitrust case (App Store at risk)
**Recommendation**: **HOLD**
Apple is a world-class business with exceptional cash generation and capital
allocation, but current valuation (36x P/E, 8% premium to DCF fair value)
offers limited margin of safety. Recommend accumulating on dips to $200-210
range (28-30x P/E). Current holders: Trim on rallies above $240.
**Confidence**: Medium (85% of companies analyzed)
**Data Sources**:
- Fundamentals: Tiingo (5-year history), FMP (ratios)
- Valuation: Custom DCF model, consensus estimates
Screen Forge - Equity Screening Agent
๐ Multi-Factor Stock Screening
You: /screen
You: Screen for value stocks with P/E under 15, P/B under 2, and market cap over $1B
Screen Forge (Equity Screening):
โ Calling screen_stocks(pe_ratio_max=15, price_to_book_max=2, market_cap_min=1000000000)
โ screen_stocks completed
โ Calling get_financial_ratios (batch for top 10 matches)
โ get_financial_ratios completed
**Value Stock Screening Results**
**Criteria**:
- P/E Ratio: < 15x (vs. S&P 500: 22x)
- Price-to-Book: < 2x (vs. S&P 500: 4.5x)
- Market Cap: > $1B (mid-cap+)
**Matches Found**: 47 stocks
**Top 10 Ranked by Quality Score** (ROE ร FCF Yield):
| Rank | Ticker | Company | P/E | P/B | Mkt Cap | ROE | FCF Yield | Quality Score |
|------|--------|---------|-----|-----|---------|-----|-----------|---------------|
| 1 | **BAC** | Bank of America | 11.2 | 1.1 | $285B | 9.8% | 8.2% | 80.4 |
| 2 | **WFC** | Wells Fargo | 10.5 | 1.3 | $182B | 11.2% | 7.1% | 79.5 |
| 3 | **INTC** | Intel | 13.8 | 1.4 | $165B | 8.9% | 6.8% | 60.5 |
| 4 | **F** | Ford Motor | 6.2 | 0.9 | $52B | 15.3% | 9.4% | 143.8 |
| 5 | **GM** | General Motors | 5.8 | 1.0 | $51B | 18.2% | 11.2% | 203.8 |
| 6 | **T** | AT&T | 8.9 | 1.5 | $135B | 7.2% | 8.9% | 64.1 |
| 7 | **VZ** | Verizon | 9.1 | 1.8 | $182B | 6.8% | 7.5% | 51.0 |
| 8 | **PFE** | Pfizer | 11.4 | 1.6 | $163B | 5.4% | 6.2% | 33.5 |
| 9 | **CVX** | Chevron | 12.5 | 1.7 | $295B | 13.8% | 5.8% | 80.0 |
| 10 | **XOM** | Exxon Mobil | 13.2 | 1.9 | $445B | 16.4% | 6.1% | 100.0 |
**Sector Breakdown**:
- Financials: 15 stocks (banks, insurance)
- Energy: 8 stocks (oil & gas)
- Industrials: 9 stocks (manufacturing)
- Utilities: 7 stocks (power, telecom)
- Consumer: 5 stocks (retail, autos)
- Technology: 3 stocks (semiconductors, legacy tech)
**Key Observations**:
1. **Value Concentration in Cyclicals**:
- Banks (BAC, WFC): Trading below book value, elevated credit risk priced in
- Autos (F, GM): Highest quality scores but cyclical earnings risk
- Energy (CVX, XOM): High FCF yield, commodity price exposure
2. **Valuation Drivers**:
- Financial sector: Credit cycle concerns, recession fears
- Energy: Oil price volatility, energy transition uncertainty
- Telecom: Mature markets, high debt loads
3. **Risk Factors**:
- โ ๏ธ **Cyclical Exposure**: 34 of 47 stocks (72%) are cyclical sectors
- โ ๏ธ **Value Trap Risk**: Low multiples may reflect structural headwinds
- โ ๏ธ **Recession Timing**: Value stocks typically lag in late expansion
**Recommended Next Steps**:
1. **Deep Dive Candidates** (for Quill analysis):
- **GM**: Highest quality score, EV transition optionality
- **BAC**: Strong deposit franchise, Fed rate cut beneficiary
- **CVX**: Energy discipline, $75B buyback, 4% dividend yield
2. **Sentiment Check** (Finnhub validation):
- Run `get_social_sentiment` for top 5 candidates
- Validate with `get_recommendation_trends` (analyst consensus)
3. **Portfolio Construction**:
- Diversify across 8-10 stocks (avoid sector concentration)
- Favor quality within value (ROE > 12%, FCF Yield > 6%)
- Monitor macro regime (value outperforms in early recession)
**Use with Quill**:
Type `/quill` then "Analyze GM and provide investment thesis" for deep-dive
fundamental analysis on top candidate.
๐๏ธ Architecture
Multi-Agent Workflow System
User Command: /analyze AAPL
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Investment Analysis Workflow (LangGraph StateGraph) โ
โ โ
โ Shared State: โ
โ - messages: [user query, agent responses] โ
โ - symbol: "AAPL" โ
โ - quill_analysis: (populated by Quill) โ
โ - macro_context: (populated by Macro Lens) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโ
โ Node 1: โ Bottom-Up Fundamental Analysis
โ Quill Agent โ โ 16 tools (FMP, Tiingo, SEC, Finnhub)
โโโโโโโโโโโโโโโโ Results stored in quill_analysis
โ
โโโโโโโโโโโโโโโโโโโโ
โ Node 2: โ Top-Down Macro Validation
โ Macro Lens โ โ 10 tools (FRED, Treasury, NewsAPI)
โโโโโโโโโโโโโโโโโโโโ Reads quill_analysis from shared state
โ
โโโโโโโโโโโโโโโโโโโโ
โ Node 3: โ Combines Both Perspectives
โ Synthesize โ โ Overall rating: BUY/HOLD/SELL
โโโโโโโโโโโโโโโโโโโโ Confidence: High/Medium/Low
โ
Final Recommendation (Markdown formatted)
Agent Architecture
Each specialized agent is built with:
- LangGraph ReAct Pattern: Reasoning โ Tool Selection โ Action โ Observation loop
- Focused Tool Set: Only tools relevant to agent's specialty (prevents tool overload)
- Streaming: Real-time progress updates to TUI
- Type Safety: Pydantic models for all tool inputs/outputs
Tools Registry
agent_tool_map = {
"quill": [
# Fundamentals (8 tools)
"get_company_fundamentals", "get_financial_ratios",
"get_historical_fundamentals", "get_dcf_valuation",
# Filings (3 tools)
"get_sec_filings", "get_latest_10k", "get_latest_10q",
# Sentiment (5 tools)
"get_insider_sentiment", "get_recommendation_trends",
"search_company_news", "get_company_news", "get_social_sentiment"
], # 16 tools
"macro_lens": [
# Macro indicators (2 tools)
"get_economic_indicator", "get_key_macro_indicators",
# Treasury (4 tools)
"get_treasury_yield_curve", "get_treasury_rate",
"get_treasury_yield_spread", "get_debt_to_gdp",
# News (2 tools)
"search_market_news", "get_top_financial_headlines",
# Files (2 tools)
"read_local_file", "list_local_files"
], # 10 tools
"screen_forge": [
# Screening (4 tools)
"screen_stocks", "get_company_fundamentals",
"get_financial_ratios", "batch_financial_ratios",
# Sentiment validation (5 tools)
"get_social_sentiment", "get_recommendation_trends",
"get_insider_sentiment", "get_company_news_sentiment",
"search_company_news"
], # 9 tools
}
๐ Documentation
Project Resources
- Backlog: Current development roadmap
- Release Notes: Detailed changelog for each version
- Architecture Specs: Technical design documents
- LangGraph Guide: Multi-agent patterns & best practices
API Reference
- Anthropic Claude: AI reasoning engine
- LangGraph: Agent orchestration framework
- Alpha Vantage: Stock market data
- FMP: Financial statements & screening
- Tiingo: Historical fundamentals
- Finnhub: Alternative data & sentiment
- FRED: Economic indicators
- SEC EDGAR: Corporate filings
Development
Running Tests
pytest # Run all tests
pytest -v # Verbose output
pytest tests/test_*.py # Specific test file
Code Quality
black src/ tests/ # Format code
ruff check src/ tests/ # Lint code
mypy src/ # Type check
Building from Source
# Install dev dependencies
pip install -e ".[dev]"
# Build package
python -m build
# Check distribution
twine check dist/*
๐บ๏ธ Roadmap
Current Release: v0.1.16
- โ Multi-agent workflows (Investment Analysis)
- โ
/analyzecommand for comprehensive analysis - โ Shared state architecture for agent collaboration
Next: v0.1.17-0.1.20
- Additional workflows (Tax Optimization, Portfolio Rebalancing)
- Atlas agent (Investment Strategist) for strategic allocation
- Human-in-the-loop checkpoints for workflow approval
- Parallel agent execution for independent analyses
Future: v0.2.0+
- Portfolio tracking & performance attribution
- Backtesting engine for investment strategies
- Risk management workflows (VaR, stress testing)
- Web UI (in addition to TUI)
- Cloud deployment options
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Ways to Contribute:
- ๐ Report bugs via GitHub Issues
- ๐ก Suggest features or improvements
- ๐ Improve documentation
- ๐ง Submit pull requests
๐ License
This project is licensed under the MIT License - see LICENSE file for details.
๐ Acknowledgments
- Anthropic - Claude AI reasoning engine
- LangChain - Agent framework ecosystem
- Textual - Modern terminal UI framework
- Data Providers - Alpha Vantage, FMP, Tiingo, Finnhub, FRED, SEC, NewsAPI
Built with โค๏ธ for retail investors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters