A production-style Python project that combines a conversational AI assistant with automatic expense detection, SQLite storage, and secure API key handling.
This project simulates a personal AI assistant that can chat naturally while also acting as a lightweight expense tracker.
It detects expense-related messages, stores them in a local SQLite database, and uses conversation memory to respond with better context over time.
- Natural language chatbot conversations
- Automatic detection of expense-related inputs
- Persistent storage using SQLite database
- Conversation memory (context-aware responses)
- Secure API key management via
.envfile (no hard-coded secrets) - Clean, minimal codebase suitable for beginners and reviewers
- Language: Python
- Database: SQLite
- APIs: OpenAI / LLM-based API (configurable)
- Environment Management:
python-dotenv - Version Control: Git & GitHub
app.py– main application logic and conversation loopdatabase.db– SQLite database for storing expensesmodels/(if present) – helpers for database or message handling.env– stores API keys and secrets (excluded from Git)requirements.txt– Python dependencies
ai-assistant/
│── app.py
│── database.db
│── requirements.txt
│── .env # not committed to Git
│── README.md
└── (any helper modules)- The user sends a message to the assistant.
- The assistant generates a natural reply using the configured AI model.
- The app checks if the message contains expense-related information (amounts, categories, etc.).
- If yes, the expense is parsed and stored in the SQLite database.
- Previous conversation history is used to maintain context and improve responses.
- Clone the repository
git clone https://github.com/harshitha1106/ai-assistant.git
cd ai-assistant- Create and activate a virtual environment
python -m venv venv
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Configure environment variables
Create a .env file in the project root:
API_KEY=your_api_key_here- Run the application
python app.py- Log daily expenses through natural conversation
- Build a starting point for a personal finance assistant
- Learn how to combine AI APIs with a local database
- Practice secure secret handling in real projects
Working on this project helped me practice:
- Structuring a small but realistic Python application
- Integrating an AI/LLM API into a backend
- Using SQLite for simple persistent storage
- Handling environment variables securely with
.env - Writing cleaner, more readable code for open source and portfolios
Harshitha
- GitHub: @harshitha1106
- Role: 2nd-year Electronics & Communication Engineering student exploring AI and web development



