LLMs in Financial Services: Personalized Portfolio Recommendation Engines

Akmal Chaudhri15:56 · Oct 2024 · 81 views
Thumbnail for LLMs in Financial Services: Personalized Portfolio Recommendation Engines Watch on YouTube
TL;DR
  1. 1

    Akmal Chaudhri builds a financial-data chatbot that combines live Kafka ticker data, stored sentiment data, and natural-language SQL queries.

  2. 2

    The demo uses LangChain's SQL agent to answer questions such as which stock had the least volatility and what the current price is for a symbol.

  3. 3

    The speech interface uses OpenAI Whisper, while the stock data is fictitious and must not be used for financial decisions.

Summary

Akmal Chaudhri presents a short notebook-based demo of a chatbot for querying financial data with natural language. A Kafka feed supplies fictitious stock tick data to a SingleStore database, while a separate table contains preloaded headline sentiment scores. LangChain's SQL agent translates English questions into database queries, allowing the user to ask about volatility, timestamps, stock performance, sentiment, and current prices. Akmal also demonstrates a speech interface built with the open-source version of OpenAI Whisper. The chatbot can answer questions outside the financial dataset by admitting when it does not know the answer. He explains how to load the sentiment data, start the ticker pipeline, inspect the records, render a candlestick chart, and clean up the database objects. He is direct about the demo's limits: the ticker data is fictional, and he has not tested every response for hallucinations.

Key ideas
01:57

Notebooks can be suitable for production when they fit the team and problem

Akmal disagrees with the assumption that notebooks should never run in production. He says some of Databricks' largest customers used notebooks in production, and SingleStore also has customers doing this. His advice is to choose the technology that the team is comfortable with and that suits the problem. He does not present notebooks as universally right. If another approach fits better, that is fine.

02:55

The demo joins a live ticker stream with stored sentiment data

The notebook uses stock tick data that arrives from a Kafka feed and a separate sentiment table that Akmal has already loaded. The ticker data keeps changing, while the sentiment table remains static for the demo. The database contains a ticker table and a sentiment table, with the latter holding almost two million records. Akmal explains that the sentiment values came from headlines processed with VADER, the Valence Aware Dictionary and sEntiment Reasoner.

04:18

The stock data is fictional and cannot support investment decisions

Akmal gives a direct warning about the data behind the demo. The ticker data is entirely fictitious and exists only for demonstration. Viewers may use the Kafka broker shown in the example, but they should not use the resulting data to make financial decisions. This limits the portfolio-recommendation claim: the session demonstrates the mechanics of querying financial-shaped data rather than offering a real investment system.

06:50

The pipeline makes incoming ticker records available for SQL analysis

Akmal tests the Kafka pipeline before starting it, retrieves a sample symbol, and displays its timestamp, open, high, low, price, and volume fields. Once the pipeline runs, the ticker table continues receiving rows. He also queries the data to produce a candlestick chart for Apple. The chart becomes more useful after the stream has run for a while, since more observations are available to inspect.

08:16

LangChain's SQL agent turns English questions into database queries

The main demonstration uses LangChain's SQL agent to query the database in ordinary English. One preset question asks which stock symbol had the least volatility in the dataset, and the agent returns a symbol. A second question asks for the most positive sentiment associated with Apple and the current best Apple price. Akmal also lets users enter their own questions, so the interface is not limited to fixed examples.

09:35

Speech input makes the database chatbot usable without typing

Akmal switches to a separate application connected to the same database. He records questions through a microphone, sends them to the chatbot, and receives spoken or displayed answers. The demo returns the number of rows in the ticker table, the earliest timestamp, the best-performing stock, and the worst-performing stock. It also handles a question about the first person on the moon by saying that it does not know, rather than forcing an answer from the financial database.

12:52

OpenAI Whisper supports multiple languages with uneven quality

In the closing discussion, Akmal says the open-source version of OpenAI Whisper can be used with multiple languages. Support is stronger for some languages than others, and the Whisper GitHub repository includes documentation and charts describing that variation. He did not train the model on his own voice, yet it performed well enough for the live demonstration.

15:15

The demo has only limited hallucination testing

When asked about hallucinations, Akmal says the system uses temperature zero to make responses as deterministic as possible. He has used it extensively and has been pleased with the answers, but he has not matched every response against a ground truth because he did not have time. His assessment is based on practical use and a general check of the results, rather than a complete evaluation.

"The tick data that I'm using is entirely fictitious. It is purely for demo purposes. Please don't use this data for making any kind of financial decisions."04:18
Who should watch
  • You are building a natural-language interface over structured financial or operational data and want to see a compact SQL-agent example.
  • You want a practical demonstration of combining a Kafka stream, a database, sentiment records, and speech input in one prototype.
  • You need to judge whether a quick LLM demo has enough evaluation behind it before using it for decisions or production workflows.