Posts Taged ollama

Wren AI: Can You Really Talk to Your Database? An Open-Source Deep Dive

Wren AI: Can You Really Talk to Your Database? An Open-Source Deep Dive

Good morning everyone, Dimitri Bellini here, back on Quadrata, my channel dedicated to the world of open source and IT. This week, we’re diving back into artificial intelligence, but with a practical twist that could change the game for many, especially in the world of business analytics.

I stumbled upon a fascinating open-source solution called Wren AI. Its promise is simple yet powerful: to let you explore complex databases and extract insights using plain, natural language. No more wrestling with intricate SQL queries just to get a simple answer. Intrigued? Let’s take a look at what it can do.

What is Wren AI? The Dawn of Generative Business Intelligence

At its core, Wren AI is an open-source tool for what’s being called Generative Business Intelligence (GenBI). Imagine asking your database, “What was our total revenue by product category last year?” and getting not just a table of numbers, but also the SQL query that generated it and a ready-to-use chart. That’s the magic of Wren AI. It acts as a translator between your human questions and the structured language of your database.

The goal is to empower users who aren’t necessarily SQL wizards—like business analysts or managers—to intertwine data from various sources and get sensible answers. Anyone who has ever tried to navigate the complex relationships in a database like Zabbix knows that finding the right connections between tables is far from trivial.

Key Features at a Glance

  • Natural Language to SQL & Charts: The main event. Ask questions in English (or other languages) and get back precise SQL queries and visualizations.
  • Broad Database Support: It connects to a wide range of data sources, including Postgres, MySQL, Microsoft SQL Server, CSV files, and more.
  • AI-Powered Insights: It uses Large Language Models (LLMs) to understand your request, analyze the database schema, and generate answers.
  • Semantic Layer: An intelligent layer that analyzes your database schema and relationships, ensuring the LLM has the correct context to generate accurate queries.

My Setup: Going Local with Ollama

To get started, you just need Docker. For the AI brain, you can connect to a cloud service like OpenAI or Gemini, but to complicate things (and for the fun of it!), I decided to run everything locally. I used Ollama to host a powerful inference engine right within my own infrastructure, running the Qwen3 32-billion parameter model. While it’s not the fastest setup, it keeps all my data in-house and proves the concept works without relying on external APIs.

The installation involves running a script they provide, but since I was using Ollama, I had to do a bit of manual configuration. This involved downloading a specific configuration file for Ollama, customizing it, and setting up some environment variables before launching the installer. Once it’s up, it leaves you with a standard Docker Compose file, so managing the stack of containers becomes straightforward.

Wren AI in Action: From Question to Dashboard

Once installed, the first step is connecting Wren AI to your data source. After providing the credentials for my Postgres test database (a sample database of DVD sales), Wren AI immediately got to work.

1. Schema Discovery

The tool automatically scanned the database, identified all the tables, and even mapped out the relationships between them. This visual representation of the schema is the foundation for everything that follows. You can even add relationships manually if needed before deploying the model.

2. Asking Questions

This is where the fun begins. I started with a simple business question:

“What is the revenue generated by films per category in 2022?”

My local Ollama instance kicked into gear (I could see my GPU usage spike to over 80%!), and after a short wait, Wren AI returned a complete answer. It didn’t just give me a number; it provided a full breakdown by category.

3. Visualizing the Data

The real power lies in the output tabs:

  • Answer: A clear, text-based summary of the findings.
  • View SQL: The exact SQL query it generated. This is a fantastic learning tool and a great starting point for further optimization.
  • Chart: An automatically generated bar chart visualizing the revenues per category. This chart can be pinned to a dashboard directly within Wren AI or exported as an SVG or PNG file—perfect for dropping into a presentation or report.

The Big Catch: A Controversial Open-Source Model

Now, for the part that didn’t sit right with me. As powerful as Wren AI is, the open-source version has a significant limitation: you can only connect to one data source. Once you configure it, the interface locks you out from adding or changing to another database. The only way to switch is to completely reset the entire project.

This feels less like a feature-limited version and more like a “castrated” one. I’m a firm believer in the open-source philosophy, and while I understand companies need to make money, crippling such a core function feels like using the “open source” label primarily as a marketing tool. Allowing users to connect to at least a few data sources would make it a genuinely usable product for home labs or small projects, while still leaving enterprise features like single sign-on or advanced security for the paid version.

Final Thoughts

Despite my criticism of its licensing model, Wren AI is an incredibly interesting and powerful solution. The ability to simplify data analysis for large, complex databases is a massive value-add, potentially saving countless hours and making data more accessible to everyone in an organization.

It’s a fantastic proof-of-concept for the future of business intelligence. The technology works, and with a decent local hardware setup or a cloud LLM, it can deliver real insights quickly. A pity, then, that the open-source version is held back by what seems to be an artificial limitation.

What do you think? Is this a fair model for an open-source project, or does it go against the spirit of the community? Have you tried any similar GenBI tools? Let me know your thoughts in the comments below!

If you enjoyed this deep dive, please give the video a like and subscribe to the Quadrata channel for more content on open source and IT.

A greeting from Dimitri, bye everyone!


Stay Connected with Me:

Read More
Finally! OpenAI Enters the Open-Source Arena with Two New Models

Finally! OpenAI Enters the Open-Source Arena with Two New Models

Good morning, everyone! Dimitri Bellini here, and welcome back to Quadrata. For a while now, I’ve been waiting for something genuinely new to discuss in the world of artificial intelligence. The on-premise, open-source scene has been buzzing, but largely dominated by excellent models from the East. I was waiting for a major American player to make a move, and finally, the moment has arrived. OpenAI, the minds behind ChatGPT, have released not one, but two completely open-source models. This is a big deal, and in this post, I’m going to break down what they are, what they can do, and put them to the test myself.

What’s New from OpenAI? A Revolution in the Making

OpenAI has released two “open-weight” models, which means we have access to the model’s core infrastructure and the data it was trained on. This is fantastic news for developers, researchers, and hobbyists like us, as it allows for deep customization. The two new models are:

  • GPT-OSS-120B: A massive 120-billion parameter model.
  • GPT-OSS-20B: A more accessible 20-billion parameter model.

This move is a significant step, especially with a permissive Apache 2.0 license, which allows for commercial use. You can build on top of these models, fine-tune them with your own data, and deploy them in your applications without the heavy licensing restrictions we often see.

Key Features That Matter

So, what makes these models stand out? Here are the highlights:

  • Truly Open License: The Apache 2.0 license gives you immense freedom to innovate and even commercialize your work.
  • Designed for Agentic Tasks: These models are built to be “agents” that can interact with tools and perform complex, multi-step tasks. While the term “agentic” is a bit of a buzzword lately, the potential is there.
  • Deeply Customizable: With open weights, you can perform post-training to tailor the model to your specific needs, creating a specialized LLM for your unique use case.
  • Full Chain of Thought: A major point of contention with closed models is their “black box” nature. You get an answer but can’t see the reasoning. These models expose their entire thought process, allowing you to understand why they reached a certain conclusion. This transparency is crucial for debugging and trust.

Choosing Your Model: Hardware and Performance

The two models cater to very different hardware capabilities.

The Powerhouse: GPT-OSS-120B

This is the star of the show, with performance comparable to the closed GPT-3.5-Turbo model. However, running it is no small feat. You’ll need some serious hardware, like an NVIDIA H100 GPU with at least 80GB of VRAM. This is not something most of us have at home, but it’s a game-changer for businesses and researchers with the right infrastructure.

The People’s Model: GPT-OSS-20B

This is the model most of us can experiment with. It’s designed to be more “human-scale” and offers performance roughly equivalent to the `o3-mini` model. The hardware requirements are much more reasonable:

  • At least 16GB of VRAM on a dedicated NVIDIA GPU.
  • A tool like Ollama or vLLM to run it (at the time of writing, Ollama already has full support!).

This is the model I’ll be focusing my tests on today.

My Hands-On Test: Putting GPT-OSS-20B to Work with Zabbix

Benchmarks are one thing, but real-world performance is what truly counts. I decided to throw a few complex, Zabbix-related challenges at the 20B model to see how it would handle them. I used LM Arena to compare its output side-by-side with another strong model of a similar size, Qwen2.

Test 1: Zabbix JavaScript Preprocessing

My first test was a niche one: I asked the model to write a Zabbix JavaScript preprocessing script to modify the output of a low-level discovery rule by adding a custom user macro. This isn’t a simple “hello world” prompt; it requires an understanding of Zabbix’s specific architecture, LLD, and JavaScript context.

The Result: I have to say, both models did an impressive job. They understood the context of Zabbix, preprocessing, and discovery macros. The JavaScript they generated was coherent and almost perfect. The GPT-OSS model’s code needed a slight tweak—it wrapped the code in a function, which isn’t necessary in Zabbix, and made a small assumption about input parameters. However, with a minor correction, the code worked. Not bad at all for a model running locally!

Test 2: Root Cause Analysis of IT Events

Next, I gave the model a set of correlated IT events with timestamps and asked it to identify the root cause. The events were:

  1. Filesystem full on a host
  2. Database instance down
  3. CRM application down
  4. Host unreachable

The Result: This is where the model’s reasoning really shone. It correctly identified that the “Filesystem full” event was the most likely root cause. It reasoned that a full disk could cause the database to crash, which in turn would bring down the CRM application that depends on it. It correctly identified the chain of dependencies. Both GPT-OSS and Qwen2 passed this test with flying colors, demonstrating strong logical reasoning.

Test 3: The Agentic Challenge

For my final test, I tried to push the “agentic” capabilities. I provided the model with a tool to interact with the Zabbix API and asked it to fetch a list of active problems. Unfortunately, this is where it stumbled. While it understood the request and even defined the tool it needed to use, it failed to actually execute the API call, instead getting stuck or hallucinating functions. This shows that while the potential for tool use is there, the implementation isn’t quite seamless yet, at least in my initial tests.

Conclusion: A Welcome and Necessary Step Forward

So, what’s my final verdict? The release of these open-source models by OpenAI is a fantastic and much-needed development. It provides a powerful, transparent, and highly customizable alternative from a Western company in a space that was becoming increasingly dominated by others. The 20B model is a solid performer, capable of impressive reasoning and coding, even if it has some rough edges with more advanced agentic tasks.

For now, it stands as another great option alongside models from Mistral and others. The true power here lies in the community. With open weights and an open license, I’m excited to see how developers will improve, fine-tune, and build upon this foundation. This is a very interesting time for local and on-premise AI.

What do you think? Have you tried the new models? What are your impressions? Let me know your thoughts in the comments below!


Stay Connected with Me:

Read More