dbagent-cli 0.9.6__tar.gz → 0.9.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/PKG-INFO +1 -1
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/__init__.py +1 -1
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/pipeline.py +9 -3
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/connectors/relational.py +5 -1
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/PKG-INFO +1 -1
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/pyproject.toml +1 -1
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/README.md +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/confidence.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/conversation.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/doctor.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/error_classifier.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/generator.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/recommender.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/agent/validator.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/cli.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/config.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/connectors/base.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/connectors/factory.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/connectors/mongo.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/__init__.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/cache.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/changeset.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/cost.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/recovery.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/sandbox.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/execution/streaming.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/anthropic_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/auto_setup.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/base.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/deepseek_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/factory.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/gemini_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/groq_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/mistral_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/mock_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/ollama_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/openai_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/llm/openrouter_provider.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/cache.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/formatter.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/graph.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/ground_truth.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/models.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/retriever.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/schema/selector.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/__init__.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/audit.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/environment.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/masking.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/modes.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/security/rbac.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/semantic/__init__.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/semantic/dictionary.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/semantic/knowledge.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/semantic/templates.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/sql/__init__.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/sql/optimizer.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/sql/validator.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/ui/chat_screen.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/ui/console.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/ui/grid_window.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/ui/viewer.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent/ui/visualizer.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/SOURCES.txt +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/dependency_links.txt +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/entry_points.txt +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/requires.txt +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/dbagent_cli.egg-info/top_level.txt +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/setup.cfg +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_cache.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_cli.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_connectors.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_direct_sql.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_doctor_and_viz.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_generator.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_graph.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_knowledge.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_providers.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_recovery.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_safety.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_sandbox.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_schema.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_security.py +0 -0
- {dbagent_cli-0.9.6 → dbagent_cli-0.9.7}/tests/test_semantic.py +0 -0
|
@@ -238,12 +238,18 @@ class QueryPipeline:
|
|
|
238
238
|
exact, fuzzy = [], []
|
|
239
239
|
|
|
240
240
|
# Inherit active tables from conversation context if follow-up prompt doesn't name tables explicitly
|
|
241
|
+
is_inherited = False
|
|
241
242
|
if not exact and not fuzzy:
|
|
242
243
|
inherited = self.conversation.get_active_tables()
|
|
243
244
|
if inherited:
|
|
244
245
|
exact = inherited[:8]
|
|
246
|
+
is_inherited = True
|
|
245
247
|
|
|
246
|
-
|
|
248
|
+
effective_prompt = user_prompt
|
|
249
|
+
if is_inherited and exact:
|
|
250
|
+
effective_prompt = f"Focus strictly on the architecture, linkages, and data flow between {', '.join(exact[:5])}. User request: {user_prompt}"
|
|
251
|
+
|
|
252
|
+
sub_schema, join_steps = self._get_fast_schema_context(effective_prompt, exact, fuzzy)
|
|
247
253
|
result.schema = sub_schema
|
|
248
254
|
result.join_steps = join_steps
|
|
249
255
|
|
|
@@ -258,9 +264,9 @@ class QueryPipeline:
|
|
|
258
264
|
source="user_guidance",
|
|
259
265
|
)
|
|
260
266
|
|
|
261
|
-
kb_context = self.knowledge_base.format_prompt_context(self.db_name,
|
|
267
|
+
kb_context = self.knowledge_base.format_prompt_context(self.db_name, effective_prompt, exact + fuzzy)
|
|
262
268
|
conv_history = self.conversation.format_context_for_prompt()
|
|
263
|
-
analysis_prompt = f"{kb_context}\n\n{
|
|
269
|
+
analysis_prompt = f"{kb_context}\n\n{effective_prompt}" if kb_context else effective_prompt
|
|
264
270
|
|
|
265
271
|
result.message = self.generator.generate_analysis_response(
|
|
266
272
|
schema=sub_schema,
|
|
@@ -47,7 +47,7 @@ def _fuzzy_match_tables(table_names: List[str], user_prompt: str) -> Tuple[List[
|
|
|
47
47
|
exact: List[str] = []
|
|
48
48
|
fuzzy: List[str] = []
|
|
49
49
|
|
|
50
|
-
# Extract meaningful words from the prompt (3+ chars, skip SQL keywords)
|
|
50
|
+
# Extract meaningful words from the prompt (3+ chars, skip SQL keywords and diagram meta-terms)
|
|
51
51
|
sql_keywords = {
|
|
52
52
|
"select", "from", "where", "join", "left", "right", "inner", "outer",
|
|
53
53
|
"order", "group", "having", "limit", "offset", "insert", "update",
|
|
@@ -57,6 +57,10 @@ def _fuzzy_match_tables(table_names: List[str], user_prompt: str) -> Tuple[List[
|
|
|
57
57
|
"drop", "index", "primary", "foreign", "key", "null", "default",
|
|
58
58
|
"hour", "minute", "day", "week", "month", "year", "ago", "today",
|
|
59
59
|
"give", "tell", "want", "need", "please", "display", "fetch",
|
|
60
|
+
"flow", "diagram", "chart", "graph", "link", "links", "structure",
|
|
61
|
+
"design", "model", "blueprint", "mapping", "mappings", "overview",
|
|
62
|
+
"query", "code", "script", "report", "summary", "relation",
|
|
63
|
+
"relations", "relationship", "relationships", "architecture", "check",
|
|
60
64
|
}
|
|
61
65
|
prompt_words = set()
|
|
62
66
|
for word in re.findall(r"\b[a-z_][a-z0-9_]*\b", prompt_lower):
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dbagent-cli"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.7"
|
|
8
8
|
description = "Enterprise AI Database Copilot, Schema Graph Introspector & Autonomous Recovery Agent (CLI)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|