Hacker News new | ask | show | jobs
Ask HN: Why is it still so hard for LLMs to query NoSQL databases?
4 points by cammasmith 21 days ago
LLMs are good at SQL. It's precise, expressive, and unambiguous. If you connect an MCP server to Postgres, then the agent can query it directly. The same cannot be said for NoSQL, and given how many people use NoSQL databases, I’m surprised there isn’t more discussion about it.

Part of the problem is diversity. MongoDB, DynamoDB, Cassandra, Redis, and Neo4j all have different query models. There's no shared interface for an LLM to reason about. So instead of writing a query, the agent has to write code: SDK calls, manual aggregation, pagination logic. It becomes more complex, harder to review, and quickly breaks on anything non-trivial.

We ran into this problem with DynamoDB specifically and ended up building our own solution. I wrote about it here if anyone's curious: https://dynamosql.hashnode.dev/why-llm-agents-still-can-t-query-nosql-databases. But I'm more interested in how others have handled this. Why is it still such an unresolved problem?

1 comments

This reads like an wholesale AI-generated blog post and HN submission.
I used AI to help write the article, but the ideas and the technical perspective are mine. This wasn't made wholesale. I've been working on creating an MCP server for DynamoDB, and have been thinking a lot about how much better AI works with SQL than without it. Considering how many people use DynamoDB, it surprises me that there aren't better ways to get AI to interact with it. Just wondering if other people feel the same way.