AI Chatbot for Natural-Language Reporting

Job ID: 40573679

Budget: £1,500 – £3,000 GBP

Project Overview

We are looking for an experienced backend developer or small agency to build a natural-language reporting chatbot for our live web platform. The system will allow internal staff to query a MariaDB database using plain English, automatically converting their questions into secure, read-only SQL queries via the Anthropic Claude API.

The chatbot will display formatted data results directly in an existing web admin area and provide an option to download the output as a Word document.

Core Technical StackBackend Framework:
Symfony (PHP)
Database: MariaDB
AI Integration: Anthropic Claude API (specifically Claude Haiku 4.5 and Sonnet 4.6)
Frontend: Existing Bootstrap 4 and Vanilla JavaScript (No heavy modern frontend frameworks required)

Document Export:
Pandoc (already installed on our server environment)

Scope of Work (Phase 1 — Staff Facing)
The selected partner will develop the core chatbot architecture for internal staff use (approximately 25 users) on desktop browsers. The main deliverables are split into three layers:

1. Backend Architecture & AI Orchestration

ReportChatbotService: Build a service to manage prompt construction, communicate with the Anthropic API, handle token limits, execute validated queries, and format results.

SchemaContextProvider: Create a metadata component that safely feeds database schema tables, legacy column mappings, and specific business rules to the AI model without passing actual user data.
SqlValidatorService: Build a rigorous security layer that parses generated SQL to ensure it is strictly a "SELECT" statement, rejecting any unauthorised commands or attempts to query core system schemas.
ChatbotAuditLogger: Create an audit logging system to record every user interaction, including the raw question, generated SQL, validation status, row counts, and execution duration.

2. Database Connections & Performance Controls

Set up a dedicated, completely read-only database connection inside Symfony to ensure absolute security at the database layer. Enforce a strict 10-second query timeout at the connection level to protect live application performance from expensive queries. Implement a hard cap of 1,000 rows maximum returned to the application per query.

3. Frontend UI & Document ExportIntegrate a clean, functional chat interface page within our existing Bootstrap 4 admin dashboard. The UI must feature a text input field, a scrollable conversation thread, formatting of results into clean Markdown tables, and a standard data disclaimer. Add a "Download as Word" button that triggers a Pandoc export utility, wrapping the Markdown output in our existing document template.

Timeline & Milestones
We expect this project to be completed across 4 weeks, following a structured implementation plan: Milestone 1 (Weeks 1 to 2) — Core Foundation: Set up read-only database configurations, implement the Anthropic API connection, build the SQL validation service, and develop the audit logging schema. Milestone 2 (Week 3) — UI & Document Export: Create the admin controller, build the Bootstrap 4 chat layout, and implement the Pandoc Word exporter service. Milestone 3 (Week
4) — Hardening & Optimisation: Set up timeout controls, row capping, prompt injection defenses, and conduct initial internal testing.

Future OpportunitiesA successful engagement on Phase 1 will lead directly to subsequent contract opportunities already mapped out in our roadmap. Future phases include expanding access to external organisation administrators, building a client-side learner popup widget with application-layer scope injection, and developing automated scheduled reports.

Ideal Freelancer Requirements
Strong proficiency in PHP and extensive hands-on experience with the Symfony framework.
Proven experience integrating AI APIs, specifically Anthropic Claude or OpenAI.Expertise in relational database design, performance tuning, and writing complex SQL.

A security-first mindset (SQL injection prevention, input sanitisation, prompt injection mitigation).Excellent written communication skills and a reliable, structured approach to milestones.

How to Apply
To prove you have read this brief completely and are not an automated bidding bot, please start your proposal text with the exact phrase "Reporting Bot Architect".

In your application, please provide:
A brief overview of your specific experience with Symfony.
A brief example or description of a previous AI or API integration project you have successfully delivered.Your estimated fixed price or hourly framework for this 4-week scope.