Readit News logoReadit News
simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
hu3 · 3 months ago
Is this like GraphQL for MCPs?
simba-k · 3 months ago
Yes, I think its a good comparison
simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
knowsuchagency · 3 months ago
That's fantastic to hear. Did they configure django to use sqlalchemy as the ORM or were they able to make it work with django's?
simba-k · 3 months ago
Currently would have to be done on the SQLAlchemy side, but someone asked to contribute django directly. Let me see if they are still planning to do that and create/link an issue if you want to keep up with it.

You could also build an EnrichMCP server that calls your Django server manually

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
TZubiri · 3 months ago
Cool. Can you give the agent a db user with restricted read permissions?

Also, generic db question, but can you protect against resource overconsumption? Like if the junior/agent makes a query with 100 joins, can a marshall kill the process and time it out?

simba-k · 3 months ago
Yeah to restricted read, still a lot of API work to do here and we're a bit blocked by MCP itself changing its auth spec (was just republished yesterday).

If you use the lower-level enrichMCP API (without SQLAlchemy) you can fully control all retrieval logic and add things like rate limiting, not dissimilar to how you'd solve this problem with a traditional API.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
polskibus · 3 months ago
So explicit model description (kind of repeating the schema into explicit model definition) provides better results when used with LLM because it’s closer to the business domain(or maybe the extra step from DDL to business model is what confuses the LLM?). I think I’m failing to grasp why does this approach work better than straight schema fed to Llm.
simba-k · 3 months ago
Yeah, think of it as a data analyst. If I give you a Postgres account with all of our tables in it, you wouldn't even know when to start and would spend tons of time just running queries to figure out what you were looking at.

If I explain the semantic graph, entities, relationships, etc. with proper documentations and descriptions you'd be able to reason about it much faster and more accurately.

A postgres schema might have the data type and a name and a table name vs. all the rich metadata that would be required in EnrichMCP.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
skuenzli · 3 months ago
This is the motivating example I was looking for on the readme: a client making a request and an agent handling it using the MCP. Along with a log of the agent reasoning its way to the answer.
simba-k · 3 months ago
Yes but the agent reasoning is going to use an LLM, I sometimes run our openai_chat_agent example just to test things out. Try giving it a shot, ask it to do something then ask it to explain its tool use.

Obviously, it can (and sometimes will) hallucinate and make up why its using a tool. The thing is, we don't really have true LLM explainability so this is the best we can really do.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
polskibus · 3 months ago
are you saying that a current gen LLM can answer such queries with EnrichMCP directly? or does it need guidance via prompts (for example tell it which tables to look at, etc. ) ? I did expose a db schema to LLM before, and it was ok-ish, however often times the devil was in the details (one join wrong, etc.), causing the whole thing to deliver junk answers.

what is your experience with non trivial db schemas?

simba-k · 3 months ago
So one big difference is that we aren't doing text2sql here, and the framework requires clear descriptions on all fields, entities, and relationships (it literally won't run otherwise).

We also generate a few tools for the LLM specifically to explain the data model to it. It works quite well, even on complex schemas.

The use case is more transactional than analytical, though we've seen it used for both.

I recommend running the openai_chat_agent in examples/ (also supports ollama for local run) and connect it to the shop_api server and ask it a question like : "Find and explain fraud transactions"

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
revskill · 3 months ago
Do you provide prisma alternative ?
simba-k · 3 months ago
Not sure exactly what you mean here. Prisma is an ORM for developers working with databases in TypeScript. EnrichMCP is more like an ORM for AI agents. It’s not focused on replacing Prisma in your backend stack, but it serves a similar role for agents that need to understand and use your data model.

It's also Python.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
polskibus · 3 months ago
This looks very interesting but I’m not sure how to use it well. Would you mind sharing some prompts that use it and solve a real problem that you encountered ?
simba-k · 3 months ago
Imagine you're building a support agent for DoorDash. A user asks, "Why is my order an hour late?" Most teams today would build a RAG system that surfaces a help center article saying something like, "Here are common reasons orders might be delayed."

That doesn't actually solve the problem. What you really need is access to internal systems. The agent should be able to look up the order, check the courier status, pull the restaurant's delay history, and decide whether to issue a refund. None of that lives in documentation. It lives in your APIs and databases.

LLMs aren't limited by reasoning. They're limited by access.

EnrichMCP gives agents structured access to your real systems. You define your internal data model using Python, similar to how you'd define models in an ORM. EnrichMCP turns those definitions into typed, discoverable tools the LLM can use directly. Everything is schema-aware, validated with Pydantic, and connected by a semantic layer that describes what each piece of data actually means.

You can integrate with SQLAlchemy, REST APIs, or custom logic. Once defined, your agent can use tools like get_order, get_restaurant, or escalate_if_late with no additional prompt engineering.

It feels less like stitching prompts together and more like giving your agent a real interface to your business.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
aolfat · 3 months ago
Woah, it generates the SQLAlchemy automatically? How does this handle auth/security?
simba-k · 3 months ago
Yep, we can essentially convert from SQLAlchemy into an MCP server.

Auth/Security is interesting in MCP. As of yesterday a new spec was released with MCP servers converted to OAuth resource servers. There's still a lot more work to do on the MCP upstream side, but we're keeping up with it and going to have a deeper integration to have AuthZ support once the upstream enables it.

simba-k commented on Show HN: EnrichMCP – A Python ORM for Agents   github.com/featureform/en... · Posted by u/bloppe
knowsuchagency · 3 months ago
Super interesting idea. How feasible would it be to integrate this with Django?
simba-k · 3 months ago
Very! We had quite a few people do this at a hackathon we hosted this past weekend.

u/simba-k

KarmaCake day127February 20, 2019View Original