sergio

sergio

This thread is just to chat about ways we can improve the Hexdocs ↔ LLM integrations to make it best in class.

I experienced this yesterday:

I was trying to improve my image background removal code that used @kip’s wonderful Image library. My version was using erode and had jagged edges, so using Google’s new Gemini 2.5 I was able to slowly ask it about:

  1. What problem I had initially.
  2. Here are some functions the Image library has.
  3. What do you want to see docs for?
  4. Repeat #2.

After a few back and forths it gave me a great solution that worked better that my original function.

It got me thinking: is there a way to better give these ever-improving AI models the docs and be more helpful to us Elixir developers? In the case of Image, I’m not really an image manipulation guy. My company does not specialize in image manipulation. I just need to remove a chroma key background as reliably as I can as fast as I can. I would have benefitted from a chunky document that listed all the module’s functions, instead of having to copy and paste it.

Is there a more native integration like having mix docs generate a ai text version of the docs that all one beefy chunk we can place into an LLMs context?

How do you guys work with hexdocs and AI? I’m curious if there’s a much better way I’m not aware of. Thanks!

Showing Posts 1 to 10

nulltree

nulltree

Roughly three better solutions:

A combination might even yield better results :slight_smile:

kip

kip

ex_cldr Core Team

I’m very curious about the actual solution you came up with (tangential to your topic I know). Always looking for a way to improve image. And background removal is something I’ve been investigating.

garrison

garrison

Don’t all of the big providers have search tools now? I think a general solution is always going to win here.

D4no0

D4no0

Honestly I always have the problem of finding the correct documentation, especially when it comes to bigger things such a phoenix.

I don’t think that specialized prompts for a bloated LLM is the way to go, as there is no information where the data was scraped from, this is especially a problem since a library usually has multiple versions, including major versions that change or introduce new things.

I think that fine-tuning a model such as BERT with elixir documentation might be something with a lot of potential, especially since we can make it aware of different versions of libraries. I was investigating this some time ago, but my poor desktop that was built on budget is not the best fit for training models, so iterations are way too slow for experimentation.

sergio

sergio OP

Sent you a DM!

ruslandoga

ruslandoga

And there is Finally, a Replacement for BERT: Introducing ModernBERT which claims better performance on code. So maybe it would be possible to embed both docs and each function source code and then use those for lookups!

D4no0

D4no0

It’s definitely possible, as there are already fine-tuned models that understand code pretty well.

I think it’s all about the way you decide to fine-tune and measure the efficiency, for me that honestly is still black magic as I’ve never delved into theory on this topic.

This also should be doable in elixir as bumblebee supports fine-tuning: Fine-tuning — Bumblebee v0.7.0

garrison

garrison

It’s interesting to consider whether RAG would actually beat full-text search (tool use) here. When I’m searching for docs my queries are almost always keyword searches, (library names, function names) - there’s not a whole lot of need for semantic lookups.

Again I really think the general solution will win here - you can do RAG on all of the docs in the world and still lose to a model that finds a blog post or forum thread which solves a given problem.

nulltree

nulltree

Interesting, I honestly think fine-tuning models is not the way to go, but rather create a system to provide the correct context to whatever LLM is the best at a given moment/in a given situation.

To that end, it should be ‘somewhat’ trivial to create a solution that always surgically inserts the newest docs of a given library when needed. Be it an MCP server that just fetches it, or a more sophisticated system that knows about the relevant libraries of a project, caches that info, and then retrieves the relevant sub-pages’ info when deemed relevant.

D4no0

D4no0

I think it depends on what you plan to be your end result.

I never cared about models guiding me on steps how to write code, but instead I want a flexible way to search for documentation. Either way, elixir core team said they are working on making such a tool happen, we will see what their end result will look like and the approach they decided to take.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews