HN user

tango12

839 karma

Founder @ promptql.io, hasura.io

Shared context is the second job nobody wants

he/him

tanmaig [at] promptql [dot] io

Posts45
Comments220
View on HN
promptql.io 3mo ago

Killing Slack was the only way to make AI accurate

tango12
2pts0
venturebeat.com 3mo ago

AI native Slack/teams: Turning conversations to context

tango12
1pts0
promptql.io 7mo ago

The semantic layer is dead. Long live the wiki

tango12
3pts0
promptql.io 10mo ago

Static AI Is Already Cutting Jobs; What Happens When It Starts to Learn?

tango12
1pts0
promptql.io 11mo ago

Being “Confidently Wrong” is holding AI back

tango12
155pts262
promptql.hasura.io 1y ago

Approaching 100% accuracy on RAG with planning

tango12
2pts0
promptql.hasura.io 1y ago

PromptQL: Data access agent with 5x accuracy, repeatability than Claude and MCP

tango12
2pts0
news.ycombinator.com 1y ago

Show HN: Hasura PromptQL: A new way of talking to your data

tango12
6pts4
news.ycombinator.com 2y ago

AI will change smart endpoints dump

tango12
1pts0
twitter.com 2y ago

How many R's in Strawberry Fix

tango12
3pts0
medium.com 2y ago

The Rise of the Serverless Monoliths

tango12
3pts0
github.com 3y ago

Streaming data in Postgres to 1M clients with GraphQL

tango12
192pts73
github.com 3y ago

GraphQL streaming API with built-in authorization for Postgres

tango12
3pts0
github.com 3y ago

Show HN: Instant streaming GraphQL APIs with built-in authorization for Postgres

tango12
6pts0
github.com 5y ago

Hasura GraphQL Engine and SQL Server

tango12
182pts83
hasura.io 5y ago

Hasura’s design philosophy – building a data API for all data sources

tango12
3pts0
news.crunchbase.com 5y ago

Grafana raises $50M in Series B funding

tango12
35pts2
blog.postman.com 6y ago

Postman raises $150M Series C at $2B valuation

tango12
5pts1
www.nytimes.com 6y ago

The Liberal World Order was built with blood

tango12
1pts0
www.techexplorist.com 6y ago

Earths magnetic field is weakening causing low-orbit satellite malfunctions

tango12
2pts0
github.com 6y ago

Hasura GraphQL Engine v1.2 release

tango12
6pts0
techcrunch.com 6y ago

Confluent raises $250m Series E at 4.2B valuation from Coatue etc.

tango12
1pts0
github.com 6y ago

Turn shell commands to HTTP APIs

tango12
2pts0
zerodha.tech 6y ago

Notes on tech from India's largest stockbroker – Bootstrapped and FOSS first

tango12
2pts0
blog.hasura.io 6y ago

Building a UI for Postgres Migrations

tango12
2pts0
blog.hasura.io 6y ago

PouchDB Syncing with Postgres: A guide with RxDB and Hasura

tango12
3pts0
www.citusdata.com 7y ago

pg_auto_failover: Postgres extension for HA and automated failover

tango12
2pts0
github.com 7y ago

Scaling to 1M active GraphQL subscriptions on Postgres

tango12
353pts80
github.com 7y ago

Scaling to 1M active GraphQL subscriptions on Postgres

tango12
3pts0
github.com 7y ago

Scaling to 1M active GraphQL subscriptions on Postgres

tango12
6pts0
Claude Tag 29 days ago

How is this multiplayer? Claude-slackbot needs to inherit my permissions for accessing scoped context and data / tools. Sounds like I need to setup specific credentials for each instance of the agent.

More importantly, claude-slackbot automatically remembering sounds like it'll be company wide AI slop? 75% of the stuff on slack should not be remembered for the future. And 90% of the stuff worth having in context is not even on the slack thread.

The AI being wrong problem is probably not insurmountable.

Humans have meta-cognition that helps them judge if they're doing a thing with lots of assumptions vs doing something that's blessed.

Humans decouple planning from execution right? Not fully but we choose when to separate it and when to not.

If we had enough data on here's a good plan given user context and here's a bad plan, it doesn't seem unreasonable to have a pretty reliable meta cognition capability on the goodness of a plan.

Author here.

You’re right in that it’s obviously not the only problem.

But without solving this seems like no matter how good the models get it’ll never be enough.

Or, yes, the biggest research breakthrough we need is reliable calibrated confidence. And that’ll allow existing models as they are to become spectacularly more useful.

What’s the eventual goal of text to sql?

Is it to build a copilot for a data analyst or to get business insight without going through an analyst?

If it’s the latter - then imho no amount of text to sql sophistication will solve the problem because it’s impossible for a non analyst to understand if the sql is correct or sufficient.

These don’t seem like text2sql problems:

Why did we hit only 80% of our daily ecommmerce transaction yesterday?

Why is customer acquisition cost trending up?

Why was the campaign in NYC worse than the same in SF?

Counter-opinion:

I totally agree with the sentiment here, but disagree with the conclusion.

1. The rest of the world doesn't have facebooks data layer. Ergo, GraphQL is very hard for everyone who's not FB.

2. Turns out GraphQL is actually a really good data API. Whether it's a postgres/mongo/graph/REST data source. Because it's a great mid-point between something as flexible as SQL but as controlled as a REST API.

Here are 3 things that GraphQL is absolutely great at:

  - Select a 2 fields out of a 100 attributes in a data model? GraphQL is great.
  - Gradually deprecate an old field in a database and replace with a new one? GraphQL is great.
  - Want a flexible way to filter/join/paginate regardless of the underlying storage layer? GraphQL is great.
Other API formats suck at this.

Working with GraphQL ought to feel like you're working entirely with your database and sprinking the right bits of transform/validation/authz business logic and then the API that other teams can use is "free".

GraphQL is dying as a replacement to a REST API layer. I think GraphQL will see its second wind as a data API. Microsoft and Google announced their GraphQL data APIs recently.

GraphQL will probably only make sense when it's as close as a 1:1 map to a DB beneath it. Whether relational or NoSQL or graph.

In all other cases, the GraphQL juice is not worth the squeeze.

I’m the founder of Hasura - sharing some notes from how I’ve seen GraphQL usage evolve over the last few years.

1. GraphQL was and remains insanely hard to build without an underlying data layer that does the heavy lifting. Without projection push-down, predicate push-down, a data layer that can support heavy parallelism it’s untenable. Exactly the problems the OP highlights - needing to “hoist”…

2. GraphQL on REST is an anti-pattern. The hype takes you there, but the juice is not worth the squeeze. The problem was lack of types? Add openapi. The problem was custom aggregation endpoints? Make it super easy / cheap to build aggregate endpoints in REST. Use an AI copilot to write an aggregate REST endpoint and a openapi schema for it even. But maybe the last thing to do is to build annd mainatian another API layer with a completely different execution model.

It’s not what it was meant for perhaps, but GraphQL’s killer use-case is an API to access / operate on data. Especially when there are multiple consumers of data (services, apps) and they don’t own the underlying data sources or speak the underlying language of the database. This turns out to be the underlying problem behind a lot of api, data modernization / migration / decomposition efforts.

The cost of this approach is implementing Graphql by building a compiler/planner with a robust authz system baked into it. A resolver based approach can never cut it, unless you resolve a query plan - aka build a compiler.

If you want to use graphql to just batch rest endpoints, it’s very likely going to become legacy tech as soon as the team that built it starts to move on.

Love this!

Curious, wouldn’t this be great for folks with internal APIs as well?

Team 1 can consume team 2’s API with an SDK instead of a raw REST client.

I think there are 2 subtleties here on where you optimize perf:

1. Frontend makes n+1 requests to the api. Either use GraphQL or build a custom endpoint that shapes a perfect response.

2. Build an api server that fetches data from the db efficiently without n+1 hitting the DB.

The whole tension introduced with resolver/data-loader ways of building GraphQL, is that while it makes 1 easy, it makes 2 harder. Compared to bespoke REST-ish endpoints.

@alex_lav: Your SQL query here is exactly what I meant! In SQL, this is easy, both to write and to optimize perf.

Implementing this with GraphQL resolvers (how folks typically write GraphQL servers) is hard - there's a users function and an articles function that are both called, so it's hard to implement those 2 functions contributing together towards a query plan. This was my point.

In fact a REST endpoint that takes a list of users and runs this query with the `IN` part parameterized is easier to build here. But the GraphQL version is a pain.

Like you said, it's not the join cost that's significant :)

But for the DB to be sending less data over the network means that the DB is doing less CPU work in helping process that data.

Benchmarking should be straightforward for a particular use-case.

The problem is that it’s hard to get the articles resolver make one query to fetch all the recent articles. So you’ll end up with n+1 fetches from the db.

In the articles resolver, you have to:

Select from articles order by created where article.user_id = X limit 5.

And you’ll have to run this statement n times - once for each user.

Not sure how a data-fetching cache layer at the app server layer will help here.

it's often much easier to scale the application server layer that the DB layer on most cases.

Hm…ignoring the specific design decision here on using json agg - I think the open question is - is that specific sentiment practically still the truth in 2023? Is it worth scaling app servers or is it better to use Postgres well and scale a managed PG offering?

Do we need to spend time writing boring code when we could instead just use DBs better? And then instead we can spend time where it matters in the app server.

And in most situations you want to "expand" the data as close as possible to the final location.

What do you mean by “expand”?

From a perf pov: Imagine you’re fetching 100 authors and each had 1000 articles, would you rather a) fetch mxn Cartesian product or b) ask the DB to send you a json aggregation where each author has a 1000 articles? There’s a significant db perf, intermediate layer ser/de, and network latency difference right?

query {

  Users (first: x) {

    …,

    articles (first: y, sortBy: CREATED) {

    ..

    }

  }
}

How would one implement the users and articles resolvers - that would be as efficient as a most_recent_views in sql?

True - but the important point worth discussing here is that most common GraphQL implementations make it really hard to think in joins.

The resolver pattern and data loader pattern make joins really painful.

eg: implement a simple top-N query (fetch 10 users and the most recent 5 articles for each) in GraphQL with a resolver tree, or even data loader.

Totally feel the pain. Ironically, most DBs have started supported really good json aggregation functions.

Combined with lateral joins, it’s possible to even push this ser/de to the DB directly and have minimal unpacking and packing in sending that data back to the client!

IMHO: The way we often approach GraphQL execution is a little dated. It’s perhaps legacy thinking from times when we had data layers that couldn’t be expected to scale even for the majority of use cases. But that has completely changed over the last 5-10 years - DBs can scale pretty massively, for specific workloads with very little work required at the app server layer. So if we used DBs to actually model as close to our domain entities as possible (and yes, we’ll need multiple DBs sooner or later), then a huge part of our work is already technically done.

So - here’s another way to approach building GraphQL:

1. Build a “read graph” so that you get a highly composable API that can almost entirely be pushed down into a data layer (eg: Postgres). This would involve techniques similar to building a compiler. Which is hard, but the great news is that it’s easy to make reusable across people who share the same data layer (Eg: Postgres).

There are only 2 business logic concerns at layer, both of which can be pushed down, which helps simplify the problem. 1) modelling/transformation: which can be done in the language of the data layer and pushed down (like views) 2) authz: which can also be done in the language of the data layer and pushed down (like rls)

2. The “command graph”: a set of controllers written in whatever language you please that makes changes to the data layer (or delegates to an orchestration system) and returns a reference to the read graph after having made changes.

This is kind of how we approach the problem at Hasura - a connector SDK that makes it easy to build reusable query compilers for different DBs or API services.

And it’s been great to see similar ideas in the ecosystem - let’s make it easy to execute a tree of functions of create a query plan, instead of executing a tree of data fetch functions (like the OP). Grafast by the postgraphile folks comes to mind.

(From hasura)

Came across this blogpost that happens to describe where something like hasura sits and how it decouples product dev (app + bff) from data api (microservice + db) dev.

Think of Hasura as a GraphQL BFD (backend for data) instead of a GraphQL BFF.

Given the complexity vs DX trade off with GraphQL presented in the post: perhaps GraphQL goes the way of SQL.

SQL is a phenomenal API but nobody builds a “sql api server” at work.

People do build products that present a sql api, because it’s a great API.

(from Hasura)

Scaling subscriptions is hard, but we work with our users/customers at scale to make sure settings are tweaked correctly.

We have users running 100k - 1M concurrent users in production for live-event type platforms. It's not completely trivial to benchmark and setup because query patterns, streaming vs live queries etc have an impact, but it works very reliably. No missing events, no problems disconnecting/reconnecting, no need for sticky sessions and so on.

An initial POC benchmark [1] should be a quick affair so if you're trying it out and run into any problems, please hit me up! Email on my bio.

[1] https://github.com/hasura/graphql-bench

Hasura CEO here. Totally hear you.

We're working on a new serverless infrastructure layer that'll make the pricing better for users compared to a DIY API server or to a self-hosted Hasura.

It's a significant engineering lift on our side - at its core we're engineering Hasura to achieve 90%+ infrastructure utlization (no cold-start, sub-millisecond auto-scaling), and that's what will allow us to do this.

Not there yet, but we'll be demo-ing and talking about the engineering at HasuraCon in June!

Hasura CEO here. If you're trying or evaluating using hasura (or nhost) along with Yugabyte / Cockroach feel free to reach out (email in bio). Happy to have our team help with any architecture or benchmarking things you might run into!

Haven’t looked at the internals or the API, but I think for starters, Hasura is designed for working on any Postgres including ones that have existing data, especially modern Postgres offerings (crunchy, alloy db, neon, Aurora, cosmos Postgres, timescale, yugabyte)

Streaming data to clients at the edge (apps or services) is a hard problem. We built an approach that keeps Postgres at the center and allows clients to consume a stream of data that is already in Postgres without any additional moving parts.

This works with read replica style scaling or with Postgres flavours that support scaling out easily (eg: Cosmos Postgres, Yugabyte & cockroach coming soon).

We recently added a streaming GraphQL API to Hasura to allow clients to easily consume data from Postgres as a stream.

There are solutions to ingest and store a large amount of data or a stream of data. However, once this data has been captured, securely exposing this data as a continuous stream to a large number of HTTP clients concurrently is a challenge. And that’s where streaming GraphQL API fits in.

Would love to see benchmarks! :)

But just for clarity in the discussion thread here, Hasura also compiles to a single query when only Postgres is being hit and I'd expect performance to be quite similar...

Ofcourse, if the GraphQL query requires federation across multiple Postgres databases or multiple databases or databases + other GraphQL / REST APIs, then Hasura breaks them up into multiple queries with a worst-case performance of a data-loader type set up.