bradley

bradley

I’ve been developing Ash resources and noticed that while AI tools work well when I provide existing examples, they struggle when creating new resources or tackling less-documented use cases. I’m exploring ways to improve AI responses by incorporating the Ash documentation.

One idea is to use the newly released Model Context Protocol from Anthropic, combined with a Retrieval-Augmented Generation (RAG) system, AWS Bedrock Knowledge Bases, or tools like Cline. This would involve downloading HEX docs for the Ash libraries, feeding them into a RAG system or knowledge base, and making them accessible for AI queries.

However, there are some challenges:

  • Ash documentation is extensive, covering multiple libraries within the ecosystem.
  • The docs are constantly updated, so I’d need a way to keep them in sync.

Alternatively, I’m considering whether the Model Context Protocol could directly access Ash documentation without requiring the setup and maintenance of a separate RAG system.

While this problem is most noticeable with Ash, it’s not unique to it—it applies to any HEX library. However, Ash is where I’ve experienced the most issues, as LLMs tend to wildly make things up when attempting to assist with it.

Before diving in, I’d like to ask:

  • Has anyone tried a similar approach?
  • Are there simpler solutions or existing tools for integrating HEX library documentation with LLMs effectively?

Any insights or suggestions would be much appreciated! :folded_hands:

First Post!

zachdaniel

zachdaniel

Creator of Ash

I can’t contribute much to this conversation except to confirm that LLMs have no idea what they are talking about when it comes to Ash :slight_smile:

I think that custom training an LLM on reference docs, example apps, etc will be the only way to have something at least halfway decent.

Most Liked

dmitriid

dmitriid

For those interested, Tidewave works:

  • follow the installation instructions
  • if you’re running in wsl, install mcp_proxy (see docs, the python one worked for me) on windows, not in wsl
  • add MCP server to your editor (e.g. Cursor)
     "tidewave-phoenix": {
        "command": "mcp-proxy",
        "args": [
          "http://localhost:4000/tidewave/mcp"
        ]
      }
    

Enjoy.

Here’s a simple rules file I now have in my Cursor that is always loaded:

# Ash Resources and Documentation

- Always use the eval tool to list or introspect Ash resources.
- When documentation about the Ash framework or its features is requested, use package_docs_search to retrieve relevant HexDocs.

And it works:

mjrusso

mjrusso

Try this out: https://hex2txt.fly.dev

You’ll want to use the hex2context notebook, which tries to find and include only the most relevant sections of documentation. (I just shipped this ten minutes ago, and there’s tons of opportunities for improvement. Note that the notebook computes all embeddings locally, but swapping in paid models should be relatively trivial. I haven’t tested different embeddings models out yet; any real-world feedback would be super useful.)

To run the notebook: Run - Livebook.dev

Direct link to source: hex2txt/notebooks/hex2context.livemd at main · mjrusso/hex2txt · GitHub

bradley

bradley OP

Just wanted to share an update, @mjrusso. I’ve been using hex2text alongside Cursor’s documentation indexing, and it’s been working pretty well. All I do is point it to the hex2text link for the library I need, and voila! I’d really love to see something like this integrated into Hex proper.

Overall, this workflow is decent, but Cursor’s index doesn’t always get utilized when I expect it to, and it still generates a fair amount of incorrect Ash code. That said, it’s still the best solution I’ve tried so far—better than Windsurfer, Copilot, Zed, Cline, and Aider.

Also, cursor just added support for MCP which is a bonus.

Last Post!

stryderjzw

stryderjzw

Thanks! Actually, after I posted, I saw your blog post. :laughing:

I’ll tweak my environment and see if I can get better results with your tips. AI’s a great tool for developers and just something we’re all gonna have to learn to use to be better programmers.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
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