This project demonstrates a Proof-of-Concept (POC) for an AI-driven stock purchasing system integrated with Zerodha. The system leverages a multi-agent workflow where individual agents analyze financial transactions, generate an investment portfolio based on user savings and risk profile, select the most suitable stocks, and execute trades with optional human approval. The project highlights how AI can augment personal finance management by automating portfolio allocation and stock selection while maintaining user oversight for final investment decisions.
Personal finance management and investment decision-making can be complex and time-consuming. Investors often need to analyze past transactions, determine available savings, allocate funds across asset classes, and choose the optimal stocks based on market conditions. This project addresses these challenges by integrating AI agents capable of autonomously performing each step of the investment process. By connecting to the Zerodha trading platform, the system demonstrates an end-to-end automated investment workflow while preserving human control through approval mechanisms.
The project follows a multi-agent architecture with three primary agents:
Reads PDF bank statements or transaction records.
Extracts monthly savings and calculates disposable income.
Determines an investment allocation based on the userโs age and insured status using the โ100 - ageโ rule.
Suggests percentages for equity (stocks), bonds, emergency fund, and insurance.
Fetches stock market data from Zerodha and filters valid equities.
Selects the best-performing stock(s) according to predefined criteria.
Awaits human approval before executing the trade and executes order.
Sample Output Snapshot:
๐ฐ Total Savings: โน5000
๐ Portfolio: {'Equity (Stocks)': 'โน2659.09', 'Bond Securities': 'โน1431.82', 'Emergency Fund': 'โน454.55', 'Insurance': 'โน454.55'}
๐ Suggested Stocks: [{'tradingsymbol': '364D100926-TB', 'price': 94.75, 'investment_amount': 2659.09}]
โณ Awaiting Approval: false
โ
Approved: true
๐น Executed Order: {'tradingsymbol': '364D100926-TB', 'price': 94.75, 'quantity': 28}
This POC project demonstrates the feasibility of integrating AI agents with a real-world trading platform to automate personal investment workflows. The system successfully analyzes financial data, generates portfolio allocations, selects stocks, and executes trades while allowing human intervention. Future extensions could include multi-month transaction analysis, dynamic risk profiling, support for multiple brokers, and integration with predictive market models for enhanced decision-making. This project provides a foundation for intelligent, semi-autonomous personal investment systems.