Chat DB - AI agent

Employer
no avatar
DataLogistix-Studio
Description

We need AI Agent Engineer to build a system that converts natural language input into validated SQL SELECT queries. The role involves designing a controlled LLM-driven pipeline that generates accurate, structured, and safe database queries in response to user prompts. This position requires strong application development skills, combined with practical experience working with large language models.

We would explore options for using an external AI model and on-premises, if feasible.

This will be integrated into an existing application, but no frontend development work is required.

It should be possible to add user-specific terminology and map it to the DB queries.

Implement tools like LangFuse and PromptFoo.

Published
on 2025-11-10
Category
Copyright
Freelancer's choice
Required functions:
1. Structured Query Generation (Programmatic Output Control): ◦ Functionality must be implemented to ensure the Large Language Model (LLM) generates a precise structured output (such as JSON or YAML) containing the final SQL statement. This guarantees a predictable output data structure that the application can parse programmatically. 2. Schema Context Delivery and Management: ◦ A function responsible for dynamically loading and presenting the database schema (metadata, table names, column names) to the model within the system prompt. This ensures the LLM has the necessary domain-specific knowledge to formulate correct queries. ◦ Crucially, this function must ensure the model receives the minimum necessary context required for precision, preventing the model's attention from being dispersed over unnecessary information. 3. Proactive Query Enrichment (Self-Querying for Indexing): ◦ Implement logic to transform or enrich the user's initial natural language query (known as Self-Querying). This is vital for ensuring index utilization, as the model must recognize when critical filtering parameters (columns necessary for indexing) are missing and either resolve the ambiguity internally or ask the user a probing question. 4. SQL Restriction and Safety Enforcement: ◦ A critical function for imposing programming restrictions on the generated output, such as limiting operations strictly to SELECT statements to prevent destructive actions (like DROP or DELETE). ◦ The code must include logic to programmatically verify the correctness of all identifiers (e.g., table and column names) generated by the LLM against the actual database schema before query execution. This verification is simpler than generation and increases application stability. 5. Error Feedback and Automatic Repair: ◦ Functionality to capture execution failures or validation issues and return comprehensive error documentation to the agent logic. The system must support an automatic repair option where the LLM can use this feedback

Offers sent (19)

Budget
Negotiable
Copyright
Freelancer's choice
Expires in
30 days

Recent jobs from category