PromptHub
Back to Blog
Developer Tools Open Source Software

investbrainapp/investbrain: Self-Hosted Investment Tracker with AI Chat

B

Bright Coding

Author

11 min read 11 views
investbrainapp/investbrain: Self-Hosted Investment Tracker with AI Chat

investbrainapp/investbrain: Self-Hosted Investment Tracker with AI Chat

Managing investments scattered across multiple brokerages is a persistent headache for technically-minded investors. You might hold ETFs at one platform, individual stocks at another, and retirement accounts elsewhere—each with its own interface, reporting quirks, and data silos. The result is a fragmented view of your actual portfolio performance, making informed decision-making unnecessarily difficult. For developers and self-hosters, the frustration compounds when proprietary tools lack transparency, charge recurring fees, or lock your data behind APIs you don't control.

investbrainapp/investbrain enters this space as a smart, open-source investment tracker built to consolidate and monitor market performance across your different brokerages. With 865 GitHub stars and active development (last commit July 8, 2026), it offers something increasingly rare: full data ownership, extensible architecture, and an AI-powered chat assistant grounded on your actual holdings—not generic market commentary. This article breaks down what investbrainapp/investbrain offers, how it works under the hood, and whether it deserves a place in your self-hosted stack.

What is investbrainapp/investbrain?

investbrainapp/investbrain is a Laravel↗ Bright Coding Blog PHP↗ Bright Coding Blog web application designed as a self-hosted investment tracking platform. Released under the CC-BY-NC 4.0 license (non-commercial), it occupies a specific niche: investors who want portfolio consolidation without surrendering data to SaaS providers, and who have the technical capacity to run Docker↗ Bright Coding Blog containers and configure environment variables.

The project's 61 forks suggest modest but genuine community engagement beyond passive stargazing. Its primary language is PHP—not the trendy choice for new projects in 2026, but a pragmatic one given Laravel's mature ecosystem for database-backed web applications, queue workers, and CLI tooling. The maintainers have invested in modern concerns: internationalization (i18n), accessibility (a11y), and dark mode support come standard.

What distinguishes investbrainapp/investbrain from simpler portfolio trackers is its extensible market data provider interface and LLM integration. Rather than hardcoding a single data source or AI vendor, the architecture treats both as pluggable services. This design philosophy matters for longevity: when Yahoo Finance changes its API terms or your preferred AI lab releases a better model, you're not waiting for upstream maintainers to catch up.

The "smart" positioning in the project's description refers specifically to its AI chat capability—an assistant that answers questions grounded on your portfolio data, not just general market knowledge. This is a meaningful distinction from generic ChatGPT queries about "should I buy Apple stock?" because the context is your actual cost basis, dividend history, and allocation percentages.

Key Features

Multi-Brokerage Portfolio Consolidation

At its core, investbrainapp/investbrain solves the fragmentation problem. You import or manually enter holdings from multiple brokerages, and the system normalizes them into unified portfolios with calculated performance metrics. The import/export system uses upsert semantics—records are created if new, updated if existing—which supports both initial migrations and ongoing synchronization workflows.

Extensible Market Data Architecture

The built-in providers cover major free and freemium sources: Yahoo Finance, Twelve Data, Finnhub, Alpaca, and Alpha Vantage. More significantly, the MarketDataInterface allows custom implementations. The fallback mechanism is genuinely useful: configure MARKET_DATA_PROVIDER=yahoo,alphavantage and if Yahoo's API fails or gets blocked, Alpha Vantage attempts automatically. This resilience matters for self-hosted tools where you can't just "escalate to support" when a provider changes its rate limits.

AI Chat with Portfolio Context

The LLM integration supports OpenAI, Anthropic, Gemini, xAI, Azure, Groq, DeepSeek, Mistral, and Ollama. The critical architectural choice is grounding: the assistant reasons over your actual holdings data, not just general training knowledge. For Ollama users, this enables fully local, private financial analysis without API keys or data leaving your infrastructure.

Docker-First Deployment

The recommended installation uses an official Docker image with Docker Compose. Dependencies are containerized; you don't need to manage PHP versions, queue workers, or web server configuration manually. The update path is equally container-native: docker compose stop, docker image pull, docker compose up.

CLI Automation

Seven documented Artisan commands handle data refresh, dividend recalculation, split adjustment, currency updates, and daily snapshot capture. These are designed for cron scheduling or manual execution via docker exec, making the system scriptable for users who want automated portfolio maintenance.

Use Cases

The Privacy-Conscious Investor

You refuse to grant third-party SaaS tools read access to your brokerage accounts via Plaid or similar services. investbrainapp/investbrain lets you maintain complete data locality—especially powerful when combined with Ollama for AI chat, creating a fully air-gapped financial analysis environment.

The Multi-Asset DIY Allocator

You hold taxable accounts at Fidelity, Roth IRAs at Vanguard, crypto positions on separate exchanges, and perhaps international equities through a specialty broker. No single brokerage gives you consolidated performance reporting. investbrainapp/investbrain becomes your unified layer, with custom market data providers handling assets that mainstream APIs ignore.

The Quant-Curious Developer

You want to experiment with portfolio analytics but need a data foundation first. The extensible provider interface and Laravel codebase offer hooks for custom calculations. Build a new market data adapter for an alternative data source, or extend the AI chat with specialized prompting for your strategy backtesting workflow.

The Fee-Averse Long-Term Holder

Portfolio tracking SaaS tools increasingly charge monthly subscriptions for features like dividend tracking or multi-currency support. investbrainapp/investbrain's non-commercial license means zero recurring costs beyond your own infrastructure—appealing for buy-and-hold investors where active trading tools would be overkill.

The Homelab Enthusiast

You already run Docker stacks for Plex, Home Assistant, or [INTERNAL_LINK: self-hosted monitoring]. Adding investbrainapp/investbrain fits naturally into existing infrastructure, with the same backup, networking, and update patterns you use for other services.

Installation & Setup

The maintainers explicitly recommend Docker Compose installation. Here's the exact process from the README:

Prerequisite: Docker Engine installed on your host machine.

Step 1: Download the Docker Compose file

curl -O https://raw.githubusercontent.com/investbrainapp/investbrain/main/docker-compose.yml

This retrieves the official compose configuration which defines the Investbrain application container, its dependencies, and networking.

Step 2: Configure environment variables

Edit the environment section in docker-compose.yml to your preferences. At minimum, you'll likely want to set:

  • APP_URL — your accessible URL (default: http://localhost)
  • APP_PORT — exposed HTTP port (default: 8000)
  • MARKET_DATA_PROVIDER — your preferred data source(s)
  • API keys for any non-Yahoo providers

Step 3: Start the containers

docker compose up

Initial image pulls may take several minutes. Once complete, access the registration page at:

http://localhost:8000/register

The APP_KEY for encryption is generated automatically during first run. For production deployments behind a DNS name, the README specifically warns to configure ASSET_URL—without it, styling and images break because absolute URLs are generated incorrectly.

Real Code Examples

The README provides explicit configuration patterns and commands. Here are the documented examples with context.

Market Data Provider Configuration

Single provider with default fallback:

MARKET_DATA_PROVIDER=yahoo

Multi-provider with automatic fallback chain:

MARKET_DATA_PROVIDER=yahoo,alphavantage

In this configuration, Yahoo Finance attempts first; if its API fails, Alpha Vantage triggers automatically. The comma-separated syntax is parsed sequentially until successful data retrieval.

Custom Provider Registration

After implementing MarketDataInterface, register in the configuration file:

'interfaces' => [
    //                       *  *  *
    'custom_provider' => \App\Services\CustomProviderMarketData::class,
    //                       *  *  *
],

Then activate via environment variable:

MARKET_DATA_PROVIDER=yahoo,alphavantage,custom_provider

The comment markers in the original documentation suggest this is a template where developers insert their implementation between the decorative asterisks.

CLI Command Execution Pattern

All management commands run through Docker exec:

docker exec -it investbrain-app php artisan refresh:market-data

For exploration without execution, use the help flag:

docker exec -it investbrain-app php artisan refresh:market-data --help

Log Monitoring

For troubleshooting, access Laravel logs:

# Static view
docker exec -it investbrain-app cat storage/logs/laravel.log

# Live tail
docker exec -it investbrain-app tail -f storage/logs/laravel.log

These commands are essential for diagnosing market data refresh failures or AI chat configuration issues without container shell access.

Advanced Usage & Best Practices

Provider Resilience Strategy

The README documents a specific Pi-hole blocking issue with fc.yahoo.com. If you're running DNS-level ad blocking, whitelist this domain before assuming the application is broken. More broadly, configure at least two market data providers for production use—API rate limits, IP blocks, and service changes are common with free financial data sources.

AI Chat Security Posture

The maintainers include an explicit disclaimer: "Always keep in mind the limitations of LLMs. When in doubt, consult a licensed investment advisor." This isn't mere liability coverage. LLMs hallucinate; they don't understand your personal risk tolerance, tax situation, or time horizon. Treat the chat assistant as a thought partner for structuring analysis, not for definitive recommendations.

Backup Before Batch Operations

The CLI commands include warnings about "irreversable changes." The fix:cost-basis-for-sales and sync:daily-change operations in particular can rewrite historical calculations. Export your portfolio data before running these, and validate outputs against expected values.

Resource Planning for sync:daily-change

The README explicitly flags this command as "extremely resource intensive." Don't schedule it casually on underpowered hosts or during market hours when you want responsive UI performance. Consider running it manually after market close, or on a dedicated schedule with resource monitoring.

Testing Your Installation

The project includes a PHPUnit suite using in-memory SQLite:

docker exec -it investbrain-app php artisan test

Running this after installation validates that your container environment correctly supports the application's dependencies and configuration.

Comparison with Alternatives

Feature investbrainapp/investbrain Ghostfolio GnuCash
Hosting Self-hosted (Docker) Self-hosted or cloud Desktop/local
AI Integration Native (multiple LLM providers) None None
Market Data Extensible multi-provider with fallback Limited built-in sources Manual/manual import
License CC-BY-NC 4.0 (non-commercial) AGPL-3.0 GPL-2.0+
Primary Language PHP (Laravel) TypeScript/Node.js C
Brokerage Import Manual/CSV upsert Some automated APIs OFX/QIF import

Ghostfolio offers a more polished UI and some automated brokerage connections, but lacks AI chat and the pluggable market data architecture. Its AGPL license permits commercial use, unlike investbrainapp/investbrain's non-commercial restriction.

GnuCash is the veteran option with double-entry accounting rigor, but requires manual data entry or complex import workflows. It offers no modern API integrations or AI features.

investbrainapp/investbrain's sweet spot is developers who want extensibility over polish, and who specifically value the AI chat capability with portfolio grounding.

FAQ

What license does investbrainapp/investbrain use?

CC-BY-NC 4.0—Creative Commons Attribution-NonCommercial. Commercial use requires separate permission from the maintainers.

Can I use investbrainapp/investbrain without Docker?

The README only documents Docker Compose installation. Manual PHP/Laravel setup is theoretically possible but unsupported.

Which AI providers work without internet access?

Ollama enables fully local LLM inference. Configure OLLAMA_BASE_URL to your local endpoint.

Why isn't my market data populating?

Check if fc.yahoo.com is blocked by Pi-hole or firewall. The Yahoo provider is default and commonly affected.

How do I update to the latest version?

Stop containers, pull investbrainapp/investbrain:latest, and restart. Configuration persists via environment variables.

Is my financial data sent to AI providers?

With cloud providers (OpenAI, Anthropic, etc.), portfolio context is transmitted via API. Use Ollama for complete data locality.

Can I contribute custom market data providers?

Yes—implement MarketDataInterface and submit a PR. The README explicitly invites this.

Conclusion

investbrainapp/investbrain fills a genuine gap for technical investors who want portfolio consolidation without SaaS dependency, and who see value in AI-assisted analysis grounded on their actual holdings. Its Laravel/PHP foundation is mature if not fashionable, and the extensible architecture for both market data and LLM providers shows thoughtful design for long-term maintainability.

The non-commercial license and Docker-first deployment signal clear intent: this is a personal or homelab tool, not a startup platform. If you're comfortable with container management, value data privacy, and want to experiment with AI-augmented investment tracking, investbrainapp/investbrain merits evaluation.

For developers specifically, the custom provider interface offers genuine extensibility hooks that competing tools lack. The 865-star project isn't yet a community juggernaut, but the active commit history and responsive issue patterns suggest sustainable maintenance.

Ready to explore? Clone the repository, review the docker-compose.yml, and start with the default Yahoo provider configuration. The registration page at localhost:8000 is typically running within minutes of your first docker compose up.

Get started with investbrainapp/investbrain on GitHub: https://github.com/investbrainapp/investbrain

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

All tools