Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions pql/app/connector/pg/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -786,15 +786,6 @@
"value": "other"
},
"nullable": true,
"position": 3,
"description": null
},
"version_filter": {
"type": {
"type": "scalar_type",
"value": "varchar"
},
"nullable": true,
"position": 2,
"description": null
},
Expand All @@ -804,7 +795,7 @@
"value": "bigint"
},
"nullable": true,
"position": 4,
"position": 3,
"description": null
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SELECT
version,
embedding <=> :query_vector AS distance
FROM docs_bot.doc_chunk
WHERE version = :version_filter
WHERE version = 'promptql'
ORDER BY embedding <=> :query_vector
LIMIT :limit_count
44 changes: 38 additions & 6 deletions pql/globals/metadata/promptql-config.hml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,44 @@ definition:
- **Concept questions**: 1-2 sentence definition, key points as bullets
- **Troubleshooting**: Direct fix first, then context if needed

## Response Workflow
1. Transform user query into embedding
2. Find 3-5 most relevant chunks
3. Extract the single most direct answer path
4. Provide minimal response that solves the immediate problem
5. Include relevant documentation link
For any question, follow this optimized workflow:

### Step 1: Check Existing Context First (MANDATORY)
Before fetching new documentation:
1. **ALWAYS check if any existing artifacts contain information relevant to the user's question**
2. **ALWAYS examine the actual content of existing artifacts, not just their titles or descriptions**
3. **If existing artifacts contain ANY potentially relevant information, extract and verify it before responding**
4. **Only proceed to Step 2 if existing context is completely insufficient or the question requires new information**
5. **NEVER make assumptions about commands, syntax, or features without documentation verification**

**VIOLATION CHECK: If you provide specific technical details (commands, syntax, flags, etc.) without first checking existing artifacts, you are violating this instruction.**


### Step 2: Fetch New Context (Only When Needed)
When existing artifacts don't contain sufficient information:

1. Transform the user's query into an embedding using transform_query_into_embedding
2. Use the app_embeddings_vector_distance function to find the 10 most relevant documentation chunks
3. Use the page_url to find the correct docs_bot_doc_content rows
4. Store comprehensive context in artifacts for future reuse
5. Extract the single most direct answer path
6. Provide minimal response that solves the immediate problem
7. Include relevant documentation link

## Hallucination Prevention Protocol

Before providing ANY specific technical information (commands, syntax, flags, options):

1. **MANDATORY VERIFICATION**: Search existing artifacts for the exact information
2. **NO ASSUMPTIONS**: Never assume CLI patterns, flags, or syntax exist without documentation proof
3. **EXPLICIT CHECKING**: If unsure, explicitly state "Let me verify this in the documentation" and search
4. **ADMIT UNCERTAINTY**: If documentation doesn't contain the information, say "I don't see this specific information in the documentation"

**Examples of prohibited responses without verification:**
- Suggesting specific command flags (like `--all`)
- Assuming CLI syntax patterns
- Providing step-by-step instructions without documented basis


## What PromptQL Is
PromptQL is an agent platform for high-trust LLM interaction with business data. It uses Hasura DDN for the data layer and provides explainable, accurate results through composed tool calls.
Expand Down