Back to The Times of Claw

Natural Language Database: Query Your Business Data in Plain English

DenchClaw turns your CRM database into a natural language interface — ask questions in plain English and get instant answers from your DuckDB data, no SQL required.

Kumar Abhirup
Kumar Abhirup
·7 min read
Natural Language Database: Query Your Business Data in Plain English

Natural Language Database: Query Your Business Data in Plain English

The promise of natural language databases has existed for decades — just ask your data a question, and it answers. The technology to actually deliver on this promise arrived with large language models.

DenchClaw is a practical implementation of a natural language database for business data. Here's what it actually looks like, what it can do, and where it still has rough edges.

What a Natural Language Database Query Looks Like#

Instead of building a filter UI or writing SQL:

"Show me all companies in the fintech vertical with more than 50 employees that we haven't contacted in the last 3 months"

DenchClaw:

  1. Parses your intent
  2. Generates SQL:
    SELECT c."Name", c."Industry", c."Employee Count", c."Last Contacted",
           c."Website"
    FROM v_companies c
    WHERE c."Industry" = 'Fintech'
      AND CAST(c."Employee Count" AS INTEGER) > 50
      AND (c."Last Contacted" < current_date - INTERVAL '3 months'
           OR c."Last Contacted" IS NULL)
    ORDER BY c."Last Contacted" ASC NULLS FIRST
  3. Executes against your local DuckDB
  4. Returns formatted results with a count and the top entries

From question to answer in ~3 seconds.

The Breadth of Natural Language Queries#

The range of questions you can ask is surprisingly broad:

Filtering and Finding#

  • "Find contacts whose email domain is @stripe.com"
  • "Show me deals that have been in Proposal Sent stage for more than 2 weeks"
  • "Which leads came in from the Show HN launch? (assume they have source = 'Hacker News')"
  • "Find all companies without a website URL"
  • "Show contacts whose role contains 'CTO' or 'VP Engineering'"

Aggregation and Analysis#

  • "What's my average deal size by industry?"
  • "How many new leads did I add each month this year?"
  • "What percentage of my leads convert to active customers?"
  • "What's the total value of deals closing in Q2?"

Time-Based Queries#

  • "Which contacts have I talked to most this quarter?"
  • "What changed in my pipeline last week?"
  • "Show me everything I added in the last 30 days"
  • "What deals closed in January vs February?"

Relational Queries#

  • "Show me all the people who work at companies in my pipeline"
  • "Which contacts are associated with deals over $50K?"
  • "Find all leads where the company has more than one contact in our CRM"

Insight Requests#

  • "What patterns do you see in my closed-won deals?"
  • "Which stage has the most deal drop-off?"
  • "Who are my top 5 accounts by total deal value?"
  • "Is my pipeline healthy? What's the risk level?"

Modifications#

  • "Update all contacts from Acme Corp to status 'Customer'"
  • "Add 'SaaS' to the tags for all companies in the software vertical"
  • "Mark all deals with close dates in January as 'Closed Lost' with reason 'No response'"

How the Natural Language Layer Works#

Under the hood, DenchClaw uses a text-to-SQL approach with schema injection:

Schema injection: Before answering any query, the agent loads your current database schema — object names, field names, field types, available enums. This is the context that allows it to generate accurate SQL.

Intent parsing: The LLM identifies the query type (select, update, aggregate, etc.) and maps your natural language terms to the actual field names in your schema.

SQL generation: The LLM generates DuckDB-compatible SQL, including proper handling for DuckDB's specific syntax (PIVOT views, the v_ view pattern, type casting).

Result formatting: After executing the SQL, the LLM formats the results appropriately — table format for multi-row results, prose for single-value answers, charts for aggregations.

Verification: The agent shows you the SQL it ran (if you ask), so you can verify the query is doing what you intended.

Ambiguity Resolution#

Natural language is ambiguous. DenchClaw handles this by:

Asking for clarification when the query is genuinely ambiguous:

You: "Show me the top companies" Agent: "By what metric? Total deal value, number of contacts, employee count, or something else?"

Making reasonable assumptions when there's an obvious interpretation:

You: "Show me my recent deals" Agent: Shows deals from the last 30 days, notes this is what it assumed

Learning your conventions through MEMORY.md:

Agent remembers: "When the user says 'recent,' they usually mean the last 2 weeks."

Updating Data via Natural Language#

Natural language isn't just for queries — it works for writes too:

"Add a new contact: James Liu, CTO at Mosaic, james@mosaic.tech, met at YC Demo Day, status Lead"

The agent creates the entry with all specified fields filled in. It automatically:

  • Links to the company "Mosaic" if it exists, or creates it
  • Sets default values for unspecified fields
  • Returns a confirmation with the created entry

"Mark the Acme Corp deal as Closed Won, final value $85,000, close date today"

The agent updates the entry and asks if you want to send a win notification (if you've configured that).

The Limits#

Natural language databases aren't magic. Current limitations:

Complex subqueries: Multi-level nested subqueries sometimes exceed what the LLM generates correctly. For very complex analysis, writing SQL directly (or asking the agent to try again with more specific guidance) works better.

Schema inference: The agent knows your field names but not what the values mean in business context. "Show me hot leads" only works if you've defined what "hot" means — either as a field value or by telling the agent.

Ambiguous field names: If you have fields called "Status" on multiple objects, specify which object you mean.

Very large result sets: Asking for "all contacts" in a list of 10,000 results isn't particularly useful. The natural language interface shines for filtered, analytical queries — not bulk data exports (use SQL directly for those).

Natural Language Database vs. Traditional Filtering#

CapabilityTraditional Filter UINatural Language
Multi-field filters≤5 filter panelsUnlimited
Cross-object queriesUsually impossibleYes
Analytical aggregationRarely availableYes
Custom calculated fieldsNoYes
Natural expressionNoYes
Ambiguity handlingN/A (exact match only)Yes
Learning over timeNoYes

Frequently Asked Questions#

Do I need to know SQL to use DenchClaw?#

No. Natural language is the primary interface. SQL knowledge helps for complex cases and verification, but isn't required.

How accurate is the natural language → SQL translation?#

For typical CRM queries (filtering, sorting, aggregating), accuracy is high (>95% of queries return correct results on the first try). Complex analytical queries may need iteration.

Can I see the SQL that was generated?#

Yes. Ask "show me the SQL you just ran" and the agent will display it. This is useful for learning SQL, verifying accuracy, and debugging.

What databases does this work with?#

DenchClaw uses DuckDB specifically. The natural language interface is tuned for DuckDB's dialect and the DenchClaw EAV schema. The broader OpenClaw framework supports other database backends.

Can I save a natural language query as a view?#

Yes. "Save this filter as a view called 'Hot Leads'" saves the current result set's filter configuration to your .object.yaml as a named view.

Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →

Kumar Abhirup

Written by

Kumar Abhirup

Building the future of AI CRM software.

Continue reading

DENCH

© 2026 DenchHQ · San Francisco, CA