# Nutrition Tricorder #lightning\_hackathon

**URL:** <https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624>\
**Category:** Showcase\
**Tags:** dev\
**Created:** [November 21, 2024, 9:52am UTC](https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624 "2024-11-21T09:52:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaylyesk](https://sea1.discourse-cdn.com/sambanova/user_avatar/community.sambanova.ai/jaylyesk/32/1895_2.png) [@jaylyesk](https://community.sambanova.ai/u/jaylyesk)\
**Post date:** [November 21, 2024, 9:52am UTC](https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624/1 "2024-11-21T09:52:28Z")

</div>

A SambaNova GenAI project on human nutrition.

## Inspiration

The creator was inspired by the Tricorder from Star Trek. It was a multi-function device  
with the ability to scan, record and analyze it’s immediate surrounding.

## What it does

This web client is designed to accept a wide range of inputs, including both text and  
images, which it then uses to gather rich contextual information in the form of  
knowledge graph triples from a graph database. The client combines this context with the  
user’s prompt for multi-agents reasoning before sending it to the SambaNova API for  
processing. After receiving the API’s output, the client performs additional  
post-processing before finally rendering the results on the screen for the user to see.

## How we built it

The project began with a research and design phase that spanned several days, ultimately  
leading to a focus on the domain of human nutrition. A thorough review of existing and  
emerging technologies was conducted to identify the most promising candidates for the  
upcoming sprint. To enhance the capabilities of large language models (LLMs) and vision  
language models (VLMs) with retrieval-augmented generation, the creators turned their  
attention to modeling knowledge graph (KG) data, schema, and queries. This effort  
resulted in the automated generation of KG triples, which formed the foundation of a  
global KG designed to support graph-based question answering (QA).

Following the implementation of text-only natural language QA, the creator went on to  
extend its capabilities by integrating vision-capable models for image captioning and  
visual question-answering.

## Challenges we ran into

- Limited context length on VLMs
- Aggressive rate limits on VLMs
- Modelling knowledge graph data and queries

## Accomplishments that we’re proud of

- Getting LLMs output to fit within the context length constraints of VLMs

## What we learned

- Integration of both VLMs and LLMs with semantic caching and graph-based retrieval-augmented generation is a non-trivial endeavor.

## What’s next for Nutrition Tricorder

- Recognize toxins and hazardous compounds on ingredient lists and food labels
- Extending of VLMs to process video input.

## Demo

- GitHub: [GitHub - yeirr/sambanova\_hackathon: A SambaNova GenAI project on human nutrition.](https://github.com/yeirr/sambanova_hackathon)
- Video: [https://youtu.be/xUZhT\_wbXeQ](https://youtu.be/xUZhT_wbXeQ)

---

<div class="post-metadata">

**Author:** ![jaylyesk](https://sea1.discourse-cdn.com/sambanova/user_avatar/community.sambanova.ai/jaylyesk/32/1895_2.png) [@jaylyesk](https://community.sambanova.ai/u/jaylyesk)\
**Post date:** [November 23, 2024, 6:50am UTC](https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624/2 "2024-11-23T06:50:20Z")

</div>

Edit: Updated Video URL at “[https://youtu.be/2fAoUsoE7x4](https://youtu.be/2fAoUsoE7x4)”

---

<div class="post-metadata">

**Author:** ![prafull.thokal](https://sea1.discourse-cdn.com/sambanova/user_avatar/community.sambanova.ai/prafull.thokal/32/20_2.png) [@prafull.thokal](https://community.sambanova.ai/u/prafull.thokal)\
**Post date:** [November 27, 2024, 8:06pm UTC](https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624/3 "2024-11-27T20:06:12Z")

</div>

@jaylyesk Welcome to the community! This is an impressive and innovative project that seamlessly integrates LLMs and VLMs with a knowledge graph to enhance human nutrition analysis. Great job pushing the boundaries of AI in health and nutrition!

---

<div class="post-metadata">

**Author:** ![jaylyesk](https://sea1.discourse-cdn.com/sambanova/user_avatar/community.sambanova.ai/jaylyesk/32/1895_2.png) [@jaylyesk](https://community.sambanova.ai/u/jaylyesk)\
**Post date:** [November 28, 2024, 2:40pm UTC](https://community.sambanova.ai/t/nutrition-tricorder-lightning-hackathon/624/5 "2024-11-28T14:40:04Z")

</div>

Thank you for the feedback. It is a promising area with tons of headroom for expansion as the first phase of radical life extension starting with lifestyle, diet and supplement.
