My first steps with Weaviate (and why I hate Python ;) )

Hi all,

(DISCLAIMER: this post may contain some rants about Python and other technologies I don’t like :wink: )
(DISCLAIMER2: as I’m working for a State, I cannot use AI models hosted in the cloud, so local solutions like Ollama are my only world)

For some weeks now, I started working on LLMs, RAG and agents. Mainly to build security-focused tools, such as a simple script/program which:

  • Generates relevant web search queries with an original prompt sent to Ollama (also written in Golang :wink: )
  • Sends these queries to the Brave API
  • Scrapes the web pages
  • Embeds the web pages’ content and stores them in Veaviate vector DB
  • Retrieves the most relevant web pages to build a final prompt for Ollama to generate a response to the original prompt/question

For a weird reason, most AI and LLM tools are built in Python. I strongly suspect the AI community has a deep tendency for sadomasochism. Maybe I’m just too much an ol’timer more at ease with languages like C/C++ or Java.

So I started using Python based tools and libs, like Llamaindex, CrewAI, Qdrant, and other stuff from HuggingFace and GitHub. I waisted WEEKS to obtain a semi-working solution.

Then I tried Weaviate, and it changed my (rather short) life in AI:

  • Written in Golang, no dependency issues (even when using venv’s). IT JUST WORKS.
  • Finally could code in Golang, without weird syntax nor those messy tabulation/space-based code blocks, and no version issues (BraveSearch python module is a kind of Scrhroedinger Cat, depending on one lib version and/or/another incompatible one)
  • IT TOOK ME HOURS to make a fully working tool, compared to WEEKS in Python and related techno’s
  • Some hours I waisted on the Docker version before running Weaviate on bare-metal, I hate Docker almost as much as Python, this may be the topic of another article :wink:
  • I always compile my Golang scripts: so no crash in a middle of a long run because of one of those pesty version, syntax or space/tabulation issues!

I’d like more AI/LLM technologies would move from Python to other techno like Golang, C/C++, Java, or even Rust.
As you may have guessed, I’m not a software engineer anymore (was for several decades), when I still write code, I just want it to WORK, quick’n dirty, as my goals and interests are focused elsewhere (cybersecurity), AND WEAVIATE JUST ALLOWED THIS.

My only criticism about Weaviate is: too many code examples in the docs are not available in Golang.

BTW, a rather famous AI project, GitHub - danielmiessler/fabric: fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere. , was rewritten from Python to Golang for the same reasons I explained.

Have a nice day!
JC

1 Like

hi @JCP !!!

Thank you a lot for this thread :slight_smile:

Indeed we do not have all examples with go as we do in python and typescript: yet.

This also happens for our java client. But worry not! We are working to add capacity for that.

Also, if you would like to help on those examples, feel free to send PRs to GitHub - weaviate/weaviate-io: Website for the Weaviate vector database

THanks!!

Hi!

In case you want to give python another try: I’d recommend to have a look at static typing in python together with a tool like mypy (see for example here: Python Type Checking (Guide) – Real Python) - it feels like another language and eliminates allmost all of the problems you mentioned

Hi Dirk,
Thanks for the info!
It will look into this, but at first glance, this does not solve the dependencies and incompatibilities between modules.