Agentic core for DB crawling.
Project description
DB-CRAWL-AGENT
Agentic framework that translates natural language queries into analytic features, decomposes them into SQL tasks, executes them across databases, and leverages graph-based memoization for reuse.
Table of Contents
- Overview
- Mathematical Foundations of Graph-Memoized Reasoning
Overview
db-crawl is an agentic data-analysis framework that lets you query structured data warehouses using natural language. It decomposes human intent into features, tasks, and SQL plans, then executes them across databases such as PostgreSQL, Snowflake, and AWS RDS.
User Query → Feature Orchestrator → Task Decomposer → SQL Executor → Insight Generator
Key Goals: • LLM-driven feature reasoning • Automated SQL generation • Reuse via graph-memoization • Multi-database compatibility
Mathematical Foundations of Graph-Memoized Reasoning
The decision-graph memoization layer in db-crawl is not merely a system optimization — it is grounded in mathematical optimization principles that define how agentic reasoning can be made efficient, consistent, and auditable.
Optimization over Graph States
Each reasoning workflow can be represented as a property graph
( G = (V, E) ),
where nodes represent intents, decompositions, or execution steps, and edges capture information dependencies.
The system seeks an optimal reasoning graph that minimizes total computational cost while maintaining internal consistency:
[ \min_G ; \mathcal{L}(G) = \text{Cost}(G) + \lambda , \text{Inconsistency}(G) ]
- Cost(G) represents resource usage: number of LLM calls, latency, or plan complexity.
- Inconsistency(G) captures logical or causal divergence across equivalent reasoning paths.
- λ is a Lagrange-like hyperparameter balancing efficiency and reliability.
This optimization lives in a hybrid space — continuous (edge weights, confidence values) and discrete (graph structure).
Practical solvers combine:
- Gradient-based methods for differentiable parameters (confidence, utility scores).
- Combinatorial search or relaxations (e.g., Gumbel-Softmax, simulated annealing) for discrete structure updates.
Constrained Optimization for Causal Consistency
Causal consistency introduces structural constraints on permissible graph edges.
For a directed acyclic reasoning graph (DAG),
[
A_{ij} = 0 \quad \text{if no causal link } X_j \to X_i
]
The optimization thus becomes constrained: [ \min_G ; \mathcal{L}(G) \quad \text{s.t. } h(G) = 0 ] where ( h(G) ) encodes acyclicity and dependency rules.
This enables identifiability — ensuring that updates or agent inferences remain explainable and reproducible under schema changes.
Constraint handling follows classical Lagrangian and KKT formulations, allowing causal rules to act as soft or hard regularizers.
Multi-Objective Optimization for Ethical Reasoning
Beyond efficiency, trustworthy systems must optimize across multiple conflicting objectives:
[ \min_G ; [ f_1(G), f_2(G), f_3(G) ] ] where typical objectives are:
- ( f_1 ): computational efficiency,
- ( f_2 ): fairness or resource balance,
- ( f_3 ): interpretability or transparency.
The result is a Pareto frontier of reasoning graphs, each offering a different trade-off between utility and ethics.
Selecting among them involves multi-objective optimization techniques (weighted sums, evolutionary methods, or Pareto ranking).
Summary
Mathematically, the memoization layer transforms reasoning reuse into an optimization problem defined over structured decision graphs.
It blends continuous optimization (for model parameters and scores) with discrete optimization (for structural choices and cache retrieval), while maintaining causal and ethical constraints.
This formulation ensures that every reused workflow is not just efficient, but formally auditable, stable, and ethically grounded.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file db_crawl_agents-0.0.8.tar.gz.
File metadata
- Download URL: db_crawl_agents-0.0.8.tar.gz
- Upload date:
- Size: 38.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b1eccdefd57c4b929693b969acea08ad29d6d89ffde01d0cdb66476dce4b26a
|
|
| MD5 |
220ced1c21b7779b2f7d415d7fe23e7d
|
|
| BLAKE2b-256 |
31823d728a8c033e168e0a0029d0328e5c03a0781ec00173e5d4d1387117273a
|
Provenance
The following attestation bundles were made for db_crawl_agents-0.0.8.tar.gz:
Publisher:
pypi.yml on zuhorer/db-crawl-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
db_crawl_agents-0.0.8.tar.gz -
Subject digest:
3b1eccdefd57c4b929693b969acea08ad29d6d89ffde01d0cdb66476dce4b26a - Sigstore transparency entry: 798307734
- Sigstore integration time:
-
Permalink:
zuhorer/db-crawl-agent@0b2669b177abbd859c6169820a2efe0de9d501f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zuhorer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@0b2669b177abbd859c6169820a2efe0de9d501f1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file db_crawl_agents-0.0.8-py3-none-any.whl.
File metadata
- Download URL: db_crawl_agents-0.0.8-py3-none-any.whl
- Upload date:
- Size: 104.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9adc03fcde9e25b77cd8abee6d4d42b4e404cf3fa78bf075f0be696b86358859
|
|
| MD5 |
ca1a9141b395099bc2ec9d446676fe14
|
|
| BLAKE2b-256 |
3638f0ef4f98bf353900b78bddf187a7eb61de001106139df519719e5d0682d3
|
Provenance
The following attestation bundles were made for db_crawl_agents-0.0.8-py3-none-any.whl:
Publisher:
pypi.yml on zuhorer/db-crawl-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
db_crawl_agents-0.0.8-py3-none-any.whl -
Subject digest:
9adc03fcde9e25b77cd8abee6d4d42b4e404cf3fa78bf075f0be696b86358859 - Sigstore transparency entry: 798307737
- Sigstore integration time:
-
Permalink:
zuhorer/db-crawl-agent@0b2669b177abbd859c6169820a2efe0de9d501f1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/zuhorer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@0b2669b177abbd859c6169820a2efe0de9d501f1 -
Trigger Event:
push
-
Statement type: