Over the last two years, many teams have experimented with “AI chatbots” for their business. Some early prototypes appeared promising during internal reviews, but very few held up once confronted with production expectations—authentication, data accuracy, security controls, and real users with unpredictable questions.
The core lesson from early experiments is clear: LLMs often work beautifully in theory, but fail in real-world scenarios unless they are connected to reliable data, structure, context, and tools. IAToolkit was built precisely to solve that gap.
IAToolkit is an open-source framework designed specifically for that gap. It gives you a complete, production-ready base for building AI assistants that: connect to your corporate databases, run custom tools, query private documents using RAG, and serve multiple companies or business units from a single, clean architecture.
This article is written for technical founders, developers, and CTOs who want to understand what IAToolkit offers, how it’s architected, how multi-tenancy works, and what a small real-world implementation project looks like.
1. The Problem IAToolkit Solves
In simple terms, an AI assistant is like an internal ChatGPT for your company: a private, secure interface where people can ask questions and run tasks in natural language. It plays a role similar to the intranet in the 2000s—a central gateway to internal knowledge and processes.
If you’ve tried to build an internal AI assistant, you’ve probably run into some of these issues:
- Chatbots disconnected from real data. Many “LLM chatbots” only work with a simple vector store or a few uploaded PDFs and cannot query real business databases.
- One-off architectures for every POC. Each proof of concept becomes its own fragile stack with duplicated logic.
- No real workflow integration. Prototypes rarely evolve into assistants that send emails, call APIs, or trigger internal processes.
- Vendor lock-in. Closed platforms limit customization and transparency.
- Multi-client deployments are painful. Forking code for each client or department does not scale.
IAToolkit solves these issues by providing a framework built specifically for real-world scenarios: a full web app, multi-tenant architecture, SQL access, RAG, tool calling, logging, extensibility, and a clean Python API.
2. Inside the Architecture: A Framework You Can Trust
IAToolkit is designed with a clear, layered architecture that keeps concerns separated and makes the system easy to maintain, extend, and reason about. Each part of the framework plays a specific role, ensuring that your assistant remains robust as it grows in complexity.
The framework organizes its logic into well-defined layers:
- Views handle HTTP requests, authentication, sessions, and JSON/HTML responses.
- Services orchestrate core workflows—query handling, RAG, prompt rendering, authentication, history, feedback, and configuration.
- Repositories provide structured access to the internal database using SQLAlchemy.
- Infrastructure adapters connect to external systems such as LLM providers (OpenAI, Gemini), mail services, and file storage like S3.
- Common utilities include helpers for encryption, validation, routing, and error handling.
Under the hood, IAToolkit is a well-structured Flask application that keeps its components cleanly separated and easily testable through a clear service and module layout. It uses SQLAlchemy as its ORM to provide consistent, predictable data access, and relies on a comprehensive suite of automated tests to ensure reliability as you extend the framework with new companies, tools, and workflows.
3. Building a Multi-Tenant Assistant
One of the most powerful ideas in IAToolkit is the concept of a Company. A Company is a self-contained module that defines everything the AI needs to operate within a single business domain or client: data sources, prompts, tools, documents, branding, and context.
3.1 The Company Module: A Clean Boundary per Tenant
Each Company lives in its own directory, for example:
companies/
├── sample_company/
│ ├── config/
│ ├── context/
│ ├── schema/
│ ├── prompts/
│ └── sample_company.py
└── your_company/
├── config/
├── context/
├── schema/
├── prompts/
└── your_company.py
This structure gives you a natural, file-system level isolation: each client or business unit gets its own folder with its own configuration and resources. For agencies and SaaS providers, this means you can host many clients in the same deployment, while keeping their logic and knowledge cleanly separated.
3.2 Per-Company Directories: Config, Context, Schema, Prompts
Each Company has several dedicated directories:
-
config/: Contains the core configuration files for the assistant. The most important iscompany.yaml, which defines the company’s name, branding, LLM models, SQL connections, tools, document sources, and prompt categories. This file is essentially the “brain” of each Company. -
context/: Markdown files with static knowledge – business rules, procedures, FAQs, company overview. These become part of the system context for that assistant. -
schema/: YAML descriptions of each table or entity in your business database. They document column names, types, relationships, and natural-language explanations, helping the LLM generate high-quality SQL. -
prompts/: Jinja2 prompt templates for predefined complex questions, such as sales analysis, supplier reports, or risk summaries. The UI can expose these as one-click prompts. -
your_company.py: A Python class that extends a base Company class and can register custom tools or company-specific logic.
The result is a powerful multi-tenant pattern: the core IAToolkit framework is shared, but each Company folder encapsulates a complete AI assistant tailored to a specific domain or client. Adding a new client becomes a matter of copying a template Company, editing some YAML files, and implementing whatever custom tools are needed.
3.3 company.yaml: Declarative Control Over Each Assistant
At the heart of each Company lies a single file: company.yaml.
This is the declarative blueprint for that assistant. Among other things, it defines:
- Identity: company ID, display name, default locale.
- LLM configuration: which model to use and which environment variable stores its API key.
- Data sources: SQL databases, connection strings (via env vars), table inclusion/exclusion rules, and natural-language descriptions.
- Knowledge base options: document connectors (local, S3) and logical document sources for RAG.
- Tools: the functions the LLM can call, with OpenAPI-style schemas for parameters.
- Prompts & categories: pre-configured prompts with descriptions and custom fields for the UI.
- Branding: header colors, primary and secondary brand colors, and visual tweaks.
- Embedding provider: model and key for semantic search.
Instead of hard-coding any of this in Python, you configure it declaratively. That makes it much easier to spin up a new tenant, tweak a single client’s branding, or point a new assistant to a different database without modifying core code.
3.4 The Dispatcher: Connecting the LLM to Your Custom Python Logic
While company.yaml defines what tools exist, the Dispatcher is the
component that makes them actually work. It acts as a bridge between the LLM and each
Company’s custom Python code.
When the LLM decides to call a tool (for example: get_customer_summary or
generate_invoice), the Dispatcher:
- Detects which Company the user belongs to
- Loads that Company’s Python class (e.g.
AcmeCompany) - Maps the LLM tool call to a Python method inside that Company
- Validates inputs, executes the method, and returns structured output to the LLM
This design gives each Company full power to implement its own logic:
“Every Company gets its own business logic, its own functions, its own workflow automation — all without touching the core framework.”
For agencies, this means each client can have custom behaviors. For enterprises, each business unit can integrate with its own APIs and processes. For developers, it creates a clean and safe extension point that avoids code duplication.
4. From Idea to Production: A Mini Implementation Project
A realistic IAToolkit implementation for a single business unit or client usually unfolds as a structured mini-project. Based on real deployments, a full cycle of analysis, setup, configuration, tooling, testing, and rollout takes approximately three months.
4.1 What You Need
- One Python developer familiar with SQL and APIs
- One domain expert who understands key business questions
- Access to a SQL database (ideally a read-only replica)
- A small set of internal documents for RAG
- A cloud environment for hosting (Python + PostgreSQL + Redis)
4.2 Project Phases
The mini-project advances through five clear phases:
-
Phase 1 — Setup, Exploration, and Company Creation
Running IAToolkit locally, understanding the sample Company. Defining the Company’s identity, configuringcompany.yaml, connecting SQL databases, applying basic branding, and enabling authentication. -
Phase 2 — Modeling Knowledge and Data
Creating schema YAML files, writing context documents, aligning terminology with domain experts, and iterating until SQL and RAG answers become consistent and useful. -
Phase 3 — Tools, Workflows, and Documents
Adding Python tools the LLM can call, integrating APIs, loading documents into the vector store, and building structured prompts for recurrent analyses. -
Phase 4 — Pilot and Production Rollout
Deploying a pilot version to real users, collecting feedback, refining prompts and schemas, and finally deploying the production assistant with monitoring and logs.
Closing Thoughts
If your goal is to move beyond demos and into robust, secure, extensible systems, IAToolkit gives you a strong and transparent foundation. Its multi-tenant design, declarative configuration, and extensible Python tools make it ideal for organizations taking their first serious steps into AI.
Because IAToolkit is fully open source, anyone can explore it, test it, adapt it, and deploy it freely. The easiest way to understand its power is to use it in a focused mini-project: a three-month initiative where your team gains hands-on experience with prompts, SQL modeling, document integration, and custom tools in a real, high-learning environment.
Whether you're a CTO evaluating platforms or a developer curious about enterprise AI patterns, IAToolkit is an accessible, transparent, and practical place to start. You're invited to download it, clone the repo, and experiment with your own data.
{% include '_static_footer.html' %}