> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chatbots

> Build chatbots with persistent memory and time-aware context.

## Case Study: Personalizing Chatbots with Timeseries, Behaviors, and More

Chatbots powered by LLMs are redefining **customer service**, **internal communication**, and **personalized recommendations** across industries. In financial services, pharma, and even other industries, these chatbots can leverage provide more relevant, customized interactions - beyond direct Text-to-SQL querying.

### Scenario: An Investment Advisory Chatbot Assists Clients with Portfolio Decisions

* Uses **time-series data** to identify spending patterns.
* Leverages **user behavior** to suggest savings plans.
* Integrates **business logic** to enforce compliance with financial regulations.

Queries might include:

> *“What’s my portfolio’s performance trend over the last year?”*

> *“Suggest adjustments to reduce volatility while maintaining similar returns.”*

### Challenges:

* **Dynamic Personalization:** Each user’s investment history, risk profile, and interactions form a personal data layer.
* **Temporal Data Understanding:** Time-series analysis is needed to interpret trends, volatility shifts, and performance changes over specific periods.
* **Multi-Modal Context:** The chatbot should integrate behavior analytics, market conditions, and portfolio constraints into a cohesive response.

### Solution:

**Knowledge Graphs (KG) & Contextualization:**
By building a KG enriched with user segments, product categories, and historic interaction patterns, the LLM can provide responses rooted in the individual's context. When paired with Text-to-SQL capabilities, it can surface data-driven recommendations, filtering queries through the lens of each user's unique financial journey or, in the case of pharma, clinical patterns relevant to individual practitioners or researchers.

**Conversational Memory:**
Use [sessions](/core-concepts/sessions-and-caching) to maintain conversation context across multiple interactions. Each user's conversation history is stored separately, enabling the chatbot to remember previous questions and provide contextually aware responses.

Read more about our approach in our [blog](https://www.cognee.ai/blog/case-studies/cognee-case-study-with-dynamo) where we achieved a great improvement.

<img src="https://mintcdn.com/cognee/of3mX7JsgcxLIPDF/images/chatbots_eval_example_dynamo.png?fit=max&auto=format&n=of3mX7JsgcxLIPDF&q=85&s=185e653b4eec8ec0521fcdec27e753c4" alt="chatbots_eval_example_dynamo" width="748" height="256" data-path="images/chatbots_eval_example_dynamo.png" />

### A simple example with cognee

<img src="https://mintcdn.com/cognee/of3mX7JsgcxLIPDF/images/chatbots_code_example.png?fit=max&auto=format&n=of3mX7JsgcxLIPDF&q=85&s=6e037ee2aaa6374dd1af965a354cedeb" alt="chatbot_code_example" width="1786" height="1790" data-path="images/chatbots_code_example.png" />

#### Run a Demo Yourself!

Curious about how this works with cognee? Try it out in our notebook [here](https://github.com/topoteretes/cognee/blob/291f1c5a55abacdef3356fabd37ee0a677db34e1/notebooks/cognee_demo.ipynb).

#### Join the Conversation!

Have questions? Join our community now to connect with professionals, share insights, and get your questions answered!

<br />

<a href="https://discord.gg/m63hxKsp4p" target="_blank" rel="noopener noreferrer">
  <button className="button cta-button">
    Join the community
  </button>
</a>
