{"id":4878,"date":"2025-03-19T09:00:10","date_gmt":"2025-03-19T08:00:10","guid":{"rendered":"https:\/\/www.hiberus.com\/en\/blog\/?p=4878"},"modified":"2025-08-06T13:30:24","modified_gmt":"2025-08-06T11:30:24","slug":"building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide","status":"publish","type":"post","link":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/","title":{"rendered":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide"},"content":{"rendered":"<p>Have you ever wondered how to leverage AI to track your expenses effortlessly? Join me, Abbaoui Achraf, ML Engineer passionate about AI applications, as we build an <strong>AI-powered expense tracking application<\/strong> using cutting-edge tools like <strong>DeepSeek<\/strong>, <strong>Gradio<\/strong>, <strong>Pydantic<\/strong>, <strong>Pydantic-AI<\/strong>, and <strong>Supabase<\/strong>. Together, we&#8217;ll create a smart system that not only helps users manage their expenses but also provides intelligent insights about their spending patterns\u2014all while keeping their data secure in a <strong>Supabase<\/strong> database.<\/p>\n<h3>Why Supabase?<\/h3>\n<p><strong>Supabase<\/strong> provides a seamless backend-as-a-service solution, offering real-time PostgreSQL databases, authentication, and more. It\u2019s an excellent choice for this project because it allows us to focus on the application logic and the AI agent rather than worrying about setting up and managing our own database.<\/p>\n<p>Let\u2019s get started!<\/p>\n<h2>1. Setting Up the Environment<\/h2>\n<p>First, install the required libraries to set up the project. Open a terminal and run:<\/p>\n<pre><code class=\"language-bash\">pip install gradio pydantic pydantic-ai supabase logfire\r\n<\/code><\/pre>\n<p>Once the libraries are installed, we can start configuring the environment.<\/p>\n<h2>2. Configuring Logging<\/h2>\n<p>Before diving into the main app, it&#8217;s good practice to set up logging to track any issues or operations. This helps with debugging and maintaining the application.<\/p>\n<pre><code class=\"language-python\">import logfire\r\nlogfire.configure()\r\n<\/code><\/pre>\n<h2>3. Defining Data Models with Pydantic<\/h2>\n<p>We need to define the data models that represent the structure of the expenses. These models ensure that we maintain consistent and valid data throughout the app.<\/p>\n<h3>Defining Expense Categories<\/h3>\n<p>We define the different categories of expenses, such as <strong>food<\/strong>, <strong>transport<\/strong>, etc.<\/p>\n<pre><code class=\"language-python\">from enum import Enum\r\n\r\nclass ExpenseCategory(str, Enum):\r\n    FOOD = \"food\"\r\n    TRANSPORT = \"transport\"\r\n    ENTERTAINMENT = \"entertainment\"\r\n    UTILITIES = \"utilities\"\r\n    RENT = \"rent\"\r\n    OTHER = \"other\"\r\n<\/code><\/pre>\n<h3>Creating the Expense Base Model<\/h3>\n<p>This is the model that represents a single expense entry:<\/p>\n<pre><code class=\"language-python\">from pydantic import BaseModel, Field\r\nfrom datetime import date\r\nfrom uuid import UUID\r\n\r\nclass ExpenseBase(BaseModel):\r\n    uuid: UUID = Field(description='Unique ID to be generated when creating an expense')\r\n    title: str = Field(..., max_length=100)\r\n    date: date\r\n    description: str = Field(..., max_length=500)\r\n    category: ExpenseCategory\r\n    amount: float = Field(..., gt=0)\r\n<\/code><\/pre>\n<h3>Creating Result Answer Model<\/h3>\n<p>This model will structure the response from the AI agent, including the user&#8217;s tips and the list of expenses:<\/p>\n<pre><code class=\"language-python\">from typing import List, Tuple, Union\r\n\r\nclass ResultAnswer(BaseModel):\r\n    answer_to_user: str = Field(description='The answer that should be returned to the user, the answer should be good direct and in a friendly tone.')\r\n    expense: Union[List[ExpenseBase] | None]\r\n    tips_to_user: Tuple[bool, Union[str, None]]\r\n<\/code><\/pre>\n<h2>4. Integrating Pydantic-AI<\/h2>\n<p>Now that we\u2019ve defined our data models, we can create our <strong>AI agent<\/strong> using <strong>Pydantic-AI<\/strong>. This agent will be responsible for interpreting user queries, providing responses, and interacting with the <strong>Supabase<\/strong> database.<\/p>\n<pre><code class=\"language-python\">from pydantic_ai import Agent, RunContext\r\nfrom pydantic_ai.models.openai import OpenAIModel\r\nfrom pydantic_ai.usage import UsageLimits\r\nfrom supabase import Client\r\nfrom uuid import UUID\r\n\r\n@dataclass\r\nclass Dependencies:\r\n    user_uuid: UUID # For this Demo we will not use it\r\n    supabase: Client | None\r\n\r\nexpense_agent = Agent(\r\n    model=OpenAIModel(\r\n        'deepseek-chat',  # Use your model name here\r\n        base_url='&lt;https:\/\/api.deepseek.com\/v1&gt;',\r\n        api_key='your_api_key',  # Replace with your actual API key\r\n    ),\r\n    deps_type=Dependencies,\r\n    result_type=ResultAnswer,\r\n    system_prompt=(\r\n        'You are an AI agent specialized in expense tracking, tasked with helping users manage their personal finances effectively. '\r\n        'Your functionalities should include recording expenses, generating reports, sending budget alerts, and providing insights based on spending patterns.'\r\n    ),\r\n    model_settings={'temperature': 0.0} # The higher the temperature the diverse the model answers can be\r\n)\r\n\r\n<\/code><\/pre>\n<h2>5. Working with Supabase<\/h2>\n<p><!-- notionvc: d8c25986-94e9-41cd-b59a-a2f147539c8e --><\/p>\n<p>Supabase is an open-source alternative to Firebase and provides a full set of backend services such as authentication, storage, and a powerful PostgreSQL database. For this project, we will primarily use <strong>Supabase&#8217;s PostgreSQL<\/strong> database to store, retrieve, and update user expenses.<\/p>\n<h3>1. Setting Up Supabase Client<\/h3>\n<p>To interact with Supabase, you need to initialize the <strong>Supabase client<\/strong> in your app. This will allow us to make queries to the database, such as adding or retrieving expenses.<\/p>\n<pre><code class=\"language-python\">from supabase import create_client, Client\r\n\r\nurl = '&lt;https:\/\/xyz.supabase.co&gt;'  # Replace with your Supabase URL\r\nkey = 'public-anon-key'  # Replace with your Supabase API key\r\n\r\nsupabase: Client = create_client(url, key)\r\n<\/code><\/pre>\n<h3>2. Creating the Supabase Table for Expenses<\/h3>\n<p>Before adding or retrieving data from Supabase, ensure that you have created a table to store the expenses. Here&#8217;s an example SQL query to create the <code>expenses<\/code> table:<\/p>\n<pre><code class=\"language-sql\">CREATE TABLE expenses (\r\n    uuid UUID PRIMARY KEY,\r\n    title TEXT NOT NULL,\r\n    date DATE NOT NULL,\r\n    description TEXT,\r\n    category TEXT NOT NULL,\r\n    amount FLOAT NOT NULL\r\n);\r\n<\/code><\/pre>\n<p>You can run this SQL query in the <strong>Supabase Dashboard<\/strong> under the &#8220;SQL Editor&#8221; tab.<\/p>\n<hr \/>\n<h2>6. Implementing Database Interaction Functions<\/h2>\n<h3>Adding Expenses to Supabase<\/h3>\n<p>We\u2019ll implement a function that will insert expense data into the <strong>Supabase<\/strong> database:<\/p>\n<pre><code class=\"language-python\">@expense_agent.tool\r\nasync def add_to_database(ctx: RunContext[Dependencies], expenses: List[ExpenseBase]) -&gt; str:\r\n    \"\"\"\r\n    Add expenses to the database.\r\n    \"\"\"\r\n    try:\r\n        supabase: Client = ctx.deps.supabase_client\r\n        user_uuid: str = ctx.deps.user_uuid\r\n\r\n        rows_to_insert = []\r\n        for expense in expenses:\r\n            rows_to_insert.append({\r\n                \"user_uuid\": user_uuid,\r\n                \"title\": expense.title,\r\n                \"date\": expense.date.isoformat(),\r\n                \"description\": expense.description,\r\n                \"category\": expense.category.value,\r\n                \"amount\": expense.amount,\r\n            })\r\n\r\n        response = supabase.table(\"expenses\").insert(rows_to_insert).execute()\r\n        \r\n        return f\"Your Expenses have been saved. Inserted: {json.dumps(response.data, indent=2)}\"\r\n    except Exception as e:\r\n        return f\"Failed to add expenses to database. Error: {e}\"\r\n<\/code><\/pre>\n<p>This function converts the expense into a dictionary, ensuring the UUID is properly formatted, and then inserts the expense into the <strong>Supabase<\/strong> database.<\/p>\n<h2>7. Retrieving Expenses from Supabase<\/h2>\n<p>To retrieve a list of expenses from the database, we implement a function that queries the <code>expenses<\/code> table:<\/p>\n<pre><code class=\"language-python\">@expense_agent.tool\r\nasync def retrive_from_database(ctx: RunContext[Dependencies]) -&gt; str:\r\n    \"\"\"\r\n    Retrieve all expenses for the current user from the database.\r\n    \"\"\"\r\n    try:\r\n        supabase: Client = ctx.deps.supabase_client\r\n        user_uuid: str = ctx.deps.user_uuid\r\n\r\n        response = (\r\n            supabase\r\n            .table(\"expenses\")\r\n            .select(\"*\")\r\n            .eq(\"user_uuid\", user_uuid)\r\n            .order(\"created_at\", desc=True)  # or whichever order you prefer\r\n            .execute()\r\n        )\r\n\r\n        return json.dumps(response.data, indent=2)\r\n    except Exception as e:\r\n        return f\"Failed to add expenses to database. Error: {e}\"\r\n<\/code><\/pre>\n<p>This function queries all the records from the <code>expenses<\/code> table and returns them as <code>ExpenseBase<\/code> objects.<\/p>\n<h2>8. Updating Expenses in Supabase<\/h2>\n<p><!-- notionvc: 495d874f-c172-4557-9a58-0264972590fe --><\/p>\n<p>Finally, we\u2019ll add a function to update an existing expense in the database:<\/p>\n<pre><code class=\"language-python\">@expense_agent.tool\r\nasync def update_from_database(ctx: RunContext[Dependencies], expense: ExpenseBase) -&gt; str:\r\n    \"\"\"\r\n    Update an expense in the database using the expense.uuid as the primary key.\r\n    \"\"\"\r\n    try:\r\n        supabase: Client = ctx.deps.supabase_client\r\n\r\n        update_fields = {\r\n            \"title\": expense.title,\r\n            \"date\": expense.date.isoformat(),\r\n            \"description\": expense.description,\r\n            \"category\": expense.category.value,\r\n            \"amount\": expense.amount\r\n        }\r\n\r\n        # Use expense.uuid to locate the record in DB (assuming \"expense_id\" is the PK)\r\n        response = (\r\n            supabase\r\n            .table(\"expenses\")\r\n            .update(update_fields)\r\n            .eq(\"expense_id\", str(expense.uuid))\r\n            .execute()\r\n        )\r\n\r\n        return f\"Expense {expense.uuid} updated successfully. Result: {json.dumps(response.data, indent=2)}\"\r\n\r\n    except Exception as e:\r\n        return f\"Failed to add expenses to database. Error: {e}\"\r\n\r\n<\/code><\/pre>\n<h3>Other tools to help the model generate expenses<\/h3>\n<pre><code class=\"language-python\">@expense_agent.tool\r\nasync def todays_date(ctx: RunContext[Dependencies]) -&gt; str:\r\n    return str(date.today())\r\n\r\n@expense_agent.tool\r\nasync def generate_uuid(ctx: RunContext[Dependencies]) -&gt; str:\r\n    return str(uuid.uuid4())\r\n<\/code><\/pre>\n<h3>Testing the Agent response<\/h3>\n<pre><code class=\"language-python\">from IPython.display import Markdown, display\r\n\r\nr = expense_agent.run_sync(\r\n    'I did buy 10 candies each one of them with 15dh, 2 bottles of water for 5dh each, and a sandwich for 20dh.',\r\n    deps=Dependencies(\r\n        user_uuid='cdb64645-e1e4-4686-af86-de8f581b8037',\r\n        supabase_client=None\r\n    ),\r\n    usage_limits=UsageLimits(request_limit=5),\r\n)\r\nprint(f\"Answer for User:\\\\n&gt;&gt;{r.data.answer_to_user}\")\r\nprint(f\"Tips for User:\\\\n&gt;&gt;{r.data.tips_to_user[1] if r.data.tips_to_user[0] else 'No tips'}\")\r\nprint(f\"Expense Recorded:\\\\n&gt;&gt;{r.data.expense}\")\r\n<\/code><\/pre>\n<h3>Output sample<\/h3>\n<p><strong>Answer for User:<\/strong><\/p>\n<p>Your expenses have been recorded successfully. Here&#8217;s a summary of your recent expenses:<\/p>\n<ul>\n<li>Candies: 10 candies at 15dh each, total 150dh<\/li>\n<li>Bottles of water: 2 bottles at 5dh each, total 10dh<\/li>\n<li>Sandwich: 1 sandwich, total 20dh<\/li>\n<\/ul>\n<p>Total spent on food: 180dh<\/p>\n<p><strong>Tips for User:<\/strong><\/p>\n<ol>\n<li>Consider buying in bulk or looking for discounts to save on food expenses.<\/li>\n<\/ol>\n<p><strong>Expense Recorded:<\/strong><\/p>\n<pre><code class=\"language-python\">[\r\n\tExpenseBase(\r\n\t\tuuid=UUID('313af951-1c1f-493d-afd9-ab2cd0b0f0ae'), \r\n\t\ttitle='Candies', date=datetime.date(2025, 2, 24), \r\n\t\tdescription='10 candies at 15dh each', \r\n\t\tcategory=&lt;ExpenseCategory.FOOD: 'food'&gt;, \r\n\t\tamount=150.0\r\n\t),\r\n\tExpenseBase(\r\n\t\tuuid=UUID('d3979bc8-cd47-4d5b-996a-adbdbe8aea62'), \r\n\t\ttitle='Bottles of water', \r\n\t\tdate=datetime.date(2025, 2, 24), \r\n\t\tdescription='2 bottles of water at 5dh each', \r\n\t\tcategory=&lt;ExpenseCategory.FOOD: 'food'&gt;, \r\n\t\tamount=10.0\r\n\t),\r\n\tExpenseBase(\r\n\t\tuuid=UUID('c4a86d69-ff74-4888-a335-471247f03b8f'), \r\n\t\ttitle='Sandwich', \r\n\t\tdate=datetime.date(2025, 2, 24), \r\n\t\tdescription='1 sandwich', \r\n\t\tcategory=&lt;ExpenseCategory.FOOD: 'food'&gt;, \r\n\t\tamount=20.0\r\n\t)\r\n]\r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4879 size-full\" src=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26.png\" alt=\"\" width=\"2196\" height=\"222\" srcset=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26.png 2196w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-300x30.png 300w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-1024x104.png 1024w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-768x78.png 768w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-1536x155.png 1536w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-2048x207.png 2048w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-26-360x36.png 360w\" sizes=\"auto, (max-width: 2196px) 100vw, 2196px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4880 size-full\" src=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27.png\" alt=\"\" width=\"1736\" height=\"78\" srcset=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27.png 1736w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27-300x13.png 300w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27-1024x46.png 1024w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27-768x35.png 768w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27-1536x69.png 1536w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-27-360x16.png 360w\" sizes=\"auto, (max-width: 1736px) 100vw, 1736px\" \/><\/p>\n<p>The output above shows how the AI agent processes and responds to user queries about expenses. In this example, when a user mentions buying candies in a complex way, bottles of water and a sandwich the agent not only records the expenses but does the needed math and also provides personalized money-saving tips. This demonstrates the agent&#8217;s ability to combine expense tracking with intelligent financial advice.<\/p>\n<h3>Supabase Postgres Database<\/h3>\n<p><!-- notionvc: fac0d2cb-1f51-46b1-a2ae-30467cc89c7c --><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4881 size-full\" src=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28.png\" alt=\"\" width=\"1862\" height=\"239\" srcset=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28.png 1862w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28-300x39.png 300w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28-1024x131.png 1024w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28-768x99.png 768w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28-1536x197.png 1536w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-28-360x46.png 360w\" sizes=\"auto, (max-width: 1862px) 100vw, 1862px\" \/><\/p>\n<p>In Supabase dashboard, we can see that the expense_agent did add the expenses described by the user in the database.<\/p>\n<hr \/>\n<h2>9. Creating the Gradio Interface<\/h2>\n<p>We will use <strong>Gradio<\/strong> to create an interactive UI where users can input their expense details and interact with the AI agent. Here\u2019s how you can set up the UI:<\/p>\n<pre><code class=\"language-python\">import gradio as gr\r\n\r\ndef run_expense_agent(user_input, *args, **kwargs):\r\n    response = expense_agent.run_sync(\r\n        user_input,\r\n        deps=Dependencies(\r\n            user_uuid='your-user-uuid',  # Replace with the actual user UUID\r\n            supabase_client=supabase\r\n        ),\r\n        usage_limits=UsageLimits(request_limit=5),\r\n    )\r\n    return response.data.answer_to_user, response.data.tips_to_user[1] if response.data.tips_to_user[0] else 'No tips', response.data.expense\r\n\r\n# Build the interface\r\nwith gr.Blocks(theme=gr.themes.Soft()) as demo:\r\n    gr.Markdown(\"# Expense Management Assistant\")\r\n    gr.Markdown(\"Upload receipts or expenses and ask questions about your finances.\")\r\n    \r\n    with gr.Row():\r\n        with gr.Column(scale=3):\r\n            chatbot = gr.Chatbot(height=500, elem_id=\"chatbot\")\r\n            \r\n            with gr.Row():\r\n                msg = gr.MultimodalTextbox(\r\n                    placeholder=\"Upload receipts and ask questions...\", \r\n                    file_count=\"multiple\",\r\n                    file_types=[\"image\", \"pdf\"]\r\n                )\r\n                submit_btn = gr.Button(\"Submit\", variant=\"primary\")\r\n            \r\n        with gr.Column(scale=1):\r\n            with gr.Accordion(\"Tips\", open=False):\r\n                tips_output = gr.Textbox(label=\"Expense Tips\")\r\n            \r\n            with gr.Accordion(\"Expense Details\", open=False):\r\n                expense_output = gr.JSON(label=\"Extracted Data\")\r\n            \r\n            with gr.Accordion(\"Files\", open=False):\r\n                file_output = gr.Textbox(label=\"Processed Files\")\r\n    \r\n    # Set up the chat functionality\r\n    def respond(message, chat_history, files):\r\n        if message == \"\":\r\n            return \"\", chat_history, \"\", None, \"\"\r\n        \r\n        answer, tips, expense, file_info = run_expense_agent(message, files, chat_history)\r\n        chat_history.append((message, answer))\r\n        return \"\", chat_history, tips, expense, file_info\r\n\r\n    submit_btn.click(\r\n        respond,\r\n        inputs=[msg, chatbot],\r\n        outputs=[msg, chatbot, tips_output, expense_output, file_output]\r\n    )\r\n    msg.submit(\r\n        respond,\r\n        inputs=[msg, chatbot],\r\n        outputs=[msg, chatbot, tips_output, expense_output, file_output]\r\n    )\r\n\r\n    gr.Markdown(\"### Need help? Try asking:\")\r\n    gr.Examples(\r\n        [\r\n            \"What's my total expenses for this month?\",\r\n            \"Categorize this receipt for me\",\r\n            \"When was my last business expense?\",\r\n            \"Show me all expenses over $100\"\r\n        ],\r\n        inputs=msg\r\n    )\r\n\r\ndemo.launch()\r\n<\/code><\/pre>\n<h3>User interface after rendering<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4883\" src=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-1024x694.png\" alt=\"User interface after rendering\" width=\"700\" height=\"474\" srcset=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-1024x694.png 1024w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-300x203.png 300w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-768x520.png 768w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-1536x1040.png 1536w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-2048x1387.png 2048w, https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/image-29-1-360x244.png 360w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>The user interface features a clean and intuitive design with a chat-like interaction model. Users can easily input their expenses through text or by uploading receipts, while the AI assistant provides real-time feedback and financial insights. The interface also includes dedicated sections for viewing expense tips and detailed transaction data.<\/p>\n<h2>10. Testing and Deploying<\/h2>\n<div class=\"layout-content\">\n<div class=\"notion-page-content\">\n<div class=\"notion-selectable notion-text-block\" data-block-id=\"19db5509-3cd1-80c1-9b50-cffd4a010a7a\">\n<div>\n<div>\n<div contenteditable=\"false\" spellcheck=\"true\" data-content-editable-leaf=\"true\">Now that everything is set up, you can run the app locally or deploy it to a platform like <span class=\"notion-enable-hover\" data-token-index=\"1\">Heroku<\/span> or <span class=\"notion-enable-hover\" data-token-index=\"3\">DigitalOcean<\/span>. The Gradio interface will allow users to enter expense details, and the AI agent will respond with insights and store the data in <span class=\"notion-enable-hover\" data-token-index=\"5\">Supabase<\/span>.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-divider-block\" data-block-id=\"19db5509-3cd1-807b-994c-fcbfc913e85c\">\n<div class=\"notion-cursor-default\">\n<div role=\"separator\"><\/div>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-sub_header-block\" data-block-id=\"19db5509-3cd1-8056-99a2-feb77f08cc59\">\n<div>\n<h3 contenteditable=\"false\" spellcheck=\"true\" data-content-editable-leaf=\"true\">Conclusion<\/h3>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-text-block\" data-block-id=\"19db5509-3cd1-8088-a134-c554c01af3af\">\n<div>\n<div>\n<div contenteditable=\"false\" spellcheck=\"true\" data-content-editable-leaf=\"true\">In this tutorial, we\u2019ve created a fully functional AI-powered expense tracking system using <span class=\"notion-enable-hover\" data-token-index=\"1\">DeepSeek Model<\/span>, <span class=\"notion-enable-hover\" data-token-index=\"3\">Gradio<\/span>, <span class=\"notion-enable-hover\" data-token-index=\"5\">Pydantic<\/span>, <span class=\"notion-enable-hover\" data-token-index=\"7\">Pydantic-AI<\/span>, and <span class=\"notion-enable-hover\" data-token-index=\"9\">Supabase<\/span>. We\u2019ve integrated AI to interpret user queries and manage expenses, and <span class=\"notion-enable-hover\" data-token-index=\"11\">Supabase<\/span> serves as the backend database where all data is stored and retrieved.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-text-block\" data-block-id=\"19db5509-3cd1-80eb-a236-fcbfc0d8842a\">\n<div>\n<div>\n<div contenteditable=\"false\" spellcheck=\"true\" data-content-editable-leaf=\"true\">By following this tutorial, you can easily extend the system to add more features such as budget tracking, recurring expenses, and more advanced insights.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-text-block\" data-block-id=\"19db5509-3cd1-8091-a393-d7a40dc10c5d\">\n<div>\n<div>\n<div contenteditable=\"false\" spellcheck=\"true\" data-content-editable-leaf=\"true\">Thank you for reading, and happy coding!<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"notion-selectable notion-text-block\" data-block-id=\"19eb5509-3cd1-80f4-95c1-fe64fb6ed5c9\">\n<div>\n<hr \/>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"layout-margin-right\"><\/div>\n<div>\n<p><span data-contrast=\"auto\">At <a href=\"https:\/\/www.hiberus.com\/en\">hiberus<\/a>, we are ready to help you implement AI in your organization. Our expertise in <a href=\"https:\/\/www.hiberus.com\/en\/partners\/aws\">generative AI<\/a>\u00a0allows us to design personalized solutions that drive your business toward the future.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Contact us to discover how AI can revolutionize your business!<\/span><\/b><\/p>\n<p><span data-teams=\"true\"><span class=\"ui-provider nt beh bei bej bek bel bem ben beo bep beq ber bes bet beu bev bew bex bey bez bfa bfb bfc bfd bfe bff bfg bfh bfi bfj bfk bfl bfm bfn bfo\" dir=\"ltr\">        <div class=\"row\">\n            <div class=\"block-cta-form\" style=\"background-color: #003664;\">\n                <div class=\"content-cta-form\">\n                    <div class=\"text-cta-form\">\n                        <h3>Want to learn more about Artificial Intelligence for your company?<\/h3>\n                        <p>Contact with our Data &amp; AI team<\/p>\n                    <\/div>\n                    <div class=\"form-fields\">\n                        \n<div class=\"wpcf7 no-js\" id=\"wpcf7-f268-o1\" lang=\"en-US\" dir=\"ltr\" data-wpcf7-id=\"268\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/en\/blog\/wp-json\/wp\/v2\/posts\/4878#wpcf7-f268-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<fieldset class=\"hidden-fields-container\"><input type=\"hidden\" name=\"_wpcf7\" value=\"268\" \/><input type=\"hidden\" name=\"_wpcf7_version\" value=\"6.1.5\" \/><input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/><input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f268-o1\" \/><input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/><input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/><input type=\"hidden\" name=\"_wpcf7_recaptcha_response\" value=\"\" \/>\n<\/fieldset>\n<div id=\"responsive-form\" class=\"clearfix\">\n\t<div class=\"form-row\">\n\t\t<div class=\"column-half\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"names\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Name *\" value=\"\" type=\"text\" name=\"names\" \/><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t\t<div class=\"column-half\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"lastname\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Last name *\" value=\"\" type=\"text\" name=\"lastname\" \/><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-half\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"mail\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Corporate email *\" value=\"\" type=\"email\" name=\"mail\" \/><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t\t<div class=\"column-half\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"phone\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-tel wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-tel\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Phone *\" value=\"\" type=\"tel\" name=\"phone\" \/><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-half\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"company\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Company *\" value=\"\" type=\"text\" name=\"company\" \/><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-full\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"message\"><textarea cols=\"40\" rows=\"10\" maxlength=\"2000\" class=\"wpcf7-form-control wpcf7-textarea wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Message *\" name=\"message\"><\/textarea><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-full color-acceptance\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"politica\"><span class=\"wpcf7-form-control wpcf7-acceptance\"><span class=\"wpcf7-list-item\"><label><input type=\"checkbox\" name=\"politica\" value=\"1\" aria-invalid=\"false\" \/><span class=\"wpcf7-list-item-label\">I have read and accept the <a href=\"https:\/\/www.hiberus.com\/en\/policy\" target=\"_blank\"><u>Privacy Policy<\/u><\/a><\/span><\/label><\/span><\/span><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-full color-acceptance\">\n\t\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"marketing\"><span class=\"wpcf7-form-control wpcf7-acceptance optional\"><span class=\"wpcf7-list-item\"><label><input type=\"checkbox\" name=\"marketing\" value=\"1\" aria-invalid=\"false\" \/><span class=\"wpcf7-list-item-label\">I would like to receive marketing communications from Hiberus and about its products, services and events.<\/span><\/label><\/span><\/span><\/span>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n\t<div class=\"form-row\">\n\t\t<div class=\"column-half\">\n\t\t\t<p><input class=\"wpcf7-form-control wpcf7-submit has-spinner\" type=\"submit\" value=\"Contact us\" \/>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n\n<!--end responsive-form--><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n        <\/span><\/span><\/p>\n<\/div>\n<p><!-- notionvc: 53f782cb-89e7-4d21-9135-1a35bbcb6f40 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever wondered how to leverage AI to track your expenses effortlessly? Join me, Abbaoui Achraf, ML Engineer passionate about AI&#8230;<\/p>\n","protected":false},"author":11,"featured_media":4889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[27],"class_list":{"0":"post-4878","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-generative-ai","8":"tag-ai"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences\" \/>\n<meta property=\"og:description\" content=\"Have you ever wondered how to leverage AI to track your expenses effortlessly? Join me, Abbaoui Achraf, ML Engineer passionate about AI...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"hiberus blog - Exploring Technology, AI, and Digital Experiences\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-19T08:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-06T11:30:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Achraf Abbaoui\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hiberus\" \/>\n<meta name=\"twitter:site\" content=\"@hiberus\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Achraf Abbaoui\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\"},\"author\":{\"name\":\"Achraf Abbaoui\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/person\/85132faf6021aa63f5813c51b5e707b8\"},\"headline\":\"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide\",\"datePublished\":\"2025-03-19T08:00:10+00:00\",\"dateModified\":\"2025-08-06T11:30:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\"},\"wordCount\":996,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png\",\"keywords\":[\"AI\"],\"articleSection\":[\"Generative AI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\",\"name\":\"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences\",\"isPartOf\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png\",\"datePublished\":\"2025-03-19T08:00:10+00:00\",\"dateModified\":\"2025-08-06T11:30:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png\",\"contentUrl\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/www.hiberus.com\/en\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#website\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/\",\"name\":\"hiberus blog - Exploring Technology, AI, and Digital Experiences\",\"description\":\"Blog for the latest updates, trends, and insights in the world of technology, artificial intelligence, and digital experiences. Stay informed!\",\"publisher\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hiberus.com\/en\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#organization\",\"name\":\"hiberus\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2023\/04\/Hiberus_blog-logo.png\",\"contentUrl\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2023\/04\/Hiberus_blog-logo.png\",\"width\":324,\"height\":70,\"caption\":\"hiberus\"},\"image\":{\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/hiberus\",\"https:\/\/www.linkedin.com\/company\/hiberus\",\"https:\/\/www.instagram.com\/hiberusit\/\",\"https:\/\/www.youtube.com\/user\/hiberusit\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/person\/85132faf6021aa63f5813c51b5e707b8\",\"name\":\"Achraf Abbaoui\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg\",\"contentUrl\":\"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg\",\"caption\":\"Achraf Abbaoui\"},\"description\":\"Machine Learning Engineer at hiberus\",\"url\":\"https:\/\/www.hiberus.com\/en\/blog\/author\/achraf-abbaoui\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/","og_locale":"en_US","og_type":"article","og_title":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences","og_description":"Have you ever wondered how to leverage AI to track your expenses effortlessly? Join me, Abbaoui Achraf, ML Engineer passionate about AI...","og_url":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/","og_site_name":"hiberus blog - Exploring Technology, AI, and Digital Experiences","article_published_time":"2025-03-19T08:00:10+00:00","article_modified_time":"2025-08-06T11:30:24+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png","type":"image\/png"}],"author":"Achraf Abbaoui","twitter_card":"summary_large_image","twitter_creator":"@hiberus","twitter_site":"@hiberus","twitter_misc":{"Written by":"Achraf Abbaoui","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#article","isPartOf":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/"},"author":{"name":"Achraf Abbaoui","@id":"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/person\/85132faf6021aa63f5813c51b5e707b8"},"headline":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide","datePublished":"2025-03-19T08:00:10+00:00","dateModified":"2025-08-06T11:30:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/"},"wordCount":996,"commentCount":0,"publisher":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/#organization"},"image":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png","keywords":["AI"],"articleSection":["Generative AI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/","url":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/","name":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide - hiberus blog - Exploring Technology, AI, and Digital Experiences","isPartOf":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png","datePublished":"2025-03-19T08:00:10+00:00","dateModified":"2025-08-06T11:30:24+00:00","breadcrumb":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#primaryimage","url":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png","contentUrl":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2025\/03\/Blog_imagen_articulo-53.png","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.hiberus.com\/en\/blog\/building-an-ai-powered-expense-tracking-system-with-gradio-pydantic-ai-supabase-and-deepseek-a-comprehensive-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/www.hiberus.com\/en\/blog\/"},{"@type":"ListItem","position":2,"name":"Building an AI-Powered Expense Tracking System with Gradio, Pydantic-AI, Supabase and DeepSeek: A Comprehensive Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.hiberus.com\/en\/blog\/#website","url":"https:\/\/www.hiberus.com\/en\/blog\/","name":"hiberus blog - Exploring Technology, AI, and Digital Experiences","description":"Blog for the latest updates, trends, and insights in the world of technology, artificial intelligence, and digital experiences. Stay informed!","publisher":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hiberus.com\/en\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hiberus.com\/en\/blog\/#organization","name":"hiberus","url":"https:\/\/www.hiberus.com\/en\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2023\/04\/Hiberus_blog-logo.png","contentUrl":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2023\/04\/Hiberus_blog-logo.png","width":324,"height":70,"caption":"hiberus"},"image":{"@id":"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/hiberus","https:\/\/www.linkedin.com\/company\/hiberus","https:\/\/www.instagram.com\/hiberusit\/","https:\/\/www.youtube.com\/user\/hiberusit"]},{"@type":"Person","@id":"https:\/\/www.hiberus.com\/en\/blog\/#\/schema\/person\/85132faf6021aa63f5813c51b5e707b8","name":"Achraf Abbaoui","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg","url":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg","contentUrl":"https:\/\/www.hiberus.com\/en\/blog\/wp-content\/uploads\/2024\/11\/1720302356161-150x150.jpg","caption":"Achraf Abbaoui"},"description":"Machine Learning Engineer at hiberus","url":"https:\/\/www.hiberus.com\/en\/blog\/author\/achraf-abbaoui\/"}]}},"_links":{"self":[{"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/posts\/4878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/comments?post=4878"}],"version-history":[{"count":7,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/posts\/4878\/revisions"}],"predecessor-version":[{"id":18865,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/posts\/4878\/revisions\/18865"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/media\/4889"}],"wp:attachment":[{"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/media?parent=4878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/categories?post=4878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiberus.com\/en\/blog\/wp-json\/wp\/v2\/tags?post=4878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}