A Python Flask application that utilizes AI chatbot capabilities (via LangChain) to interact with QuickBooks Online through API calls. This repository provides a collection of tools to perform various QuickBooks operations, all integrated into a conversational interface.
- Overview
- Features
- Architecture
- Installation
- Usage
- Extending the Toolset
- Limitations
- Contributing
- License
- Support
The QuickBooks Online Chatbot Tool is designed to simplify operations with QuickBooks Online by packaging essential API calls into tools that an AI chatbot can use. With minimal code changes (typically no more than 15 lines), you can extend the functionality to support additional QuickBooks operations.
This repository includes:
- A set of tools to perform QuickBooks API operations such as retrieving company information, listing transactions, and managing categorized/uncategorized transactions.
- A fully implemented chatbot with prompting capabilities, built to integrate seamlessly with the toolset.
- Company Information: Retrieve detailed company data from QuickBooks Online.
- Transaction Management:
- List all transactions.
- Fetch uncategorized transactions.
- Fetch categorized transactions.
- Post categorized transactions.
- Extensibility: Easily add new QuickBooks Online operations with minimal code additions.
- Chatbot Integration: Leverages LangChain to enable conversational interactions with the toolset.
- Project Management: Uses UV Python for streamlined project management and execution.
The project is structured around a Flask backend that serves both the API endpoints for QuickBooks operations and the chatbot interface. Key components include:
- Flask Application: Manages API endpoints and server logic.
- LangChain Integration: Facilitates natural language processing and conversational interactions.
- UV Python: Provides an efficient project management and execution environment.
- Tooling Layer: Each QuickBooks operation is abstracted as a tool, making the system highly modular and easy to extend.
- Python 3.x installed on your machine.
- QuickBooks Online API Credentials: Ensure you have the necessary API keys and credentials from QuickBooks.
- UV Python for project management:
- macOS: Install using Homebrew:
brew install uv
- Alternative: Install via pip:
pip install uv
- macOS: Install using Homebrew:
-
Clone the Repository
git clone <repository_url> cd <repository_directory>
-
Synchronize Project Settings (Optional) Ensure all configurations are correct by running:
uv sync
-
Run the Application Start the Flask server using UV Python:
uv run app.py
Once the application is running, you can interact with the chatbot interface to perform various QuickBooks operations. The available commands include:
- get_company_info: Retrieve company details.
- list_transactions: Get a complete list of transactions.
- get_uncategorized_transactions: Fetch transactions that haven't been categorized.
- get_categorized_transactions: Retrieve transactions that are already categorized.
- post_categorized_transaction: Categorize a transaction by posting the necessary details.
These commands are designed to be invoked by an AI language model, streamlining operations and reducing manual effort.
The architecture is designed for extensibility:
- Adding New Operations: To add a new QuickBooks Online operation, simply integrate the corresponding API call into the toolset. This process generally requires adding no more than 15 lines of code.
- Modular Design: Each tool is self-contained, making it easy to maintain and expand without affecting other components of the system.
- No Dedicated Transaction ID Field: The current data structure does not provide a unique "transaction id" field. Although some fields include an "id" property in their metadata (e.g., for the merchant/name or transaction type), these may not be unique or sufficient as a primary identifier.
- Data Extract Constraints: When processing transactions, the tool extracts all columns from the data row. However, ensure that any integrations or extensions account for the possibility of missing or non-uniform data (e.g., rows with less than the expected number of columns).
- Report Data Scope: The provided example data may be a partial extract from a larger report, and users should verify that all required data fields are populated as expected.
- QuickBooks API Variability: As the QuickBooks API evolves, certain fields or behaviors may change. Regular updates to the toolset may be necessary to maintain full compatibility with new API versions.
Contributions are welcome! Whether you're looking to add new features or improve existing functionality, please follow these guidelines:
- Fork the repository and create a new branch for your feature or bug fix.
- Ensure your code adheres to the existing style and includes appropriate tests.
- Submit a pull request with a detailed description of your changes.
For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you encounter any issues or have questions, please open an issue in the repository or contact the project maintainers.
Enhance your QuickBooks Online operations with an AI-powered chatbot—simple, extensible, and efficient!