A RAG (Retrieval-Augmented Generation) system for intelligent FAQ management in municipal government. Processes questions using semantic search with embeddings and returns answers based on official documents, laws, and regulations.
This PHP FAQ system has 11 tools with basic descriptions but critical gaps in schema completeness, parameter documentation, and error handling. Most tools lack detailed input schemas, parameters are described in text but not formally typed in JSON Schema. Descriptions are present but generic (avg ~80 chars, below the 194-char baseline). No output schemas documented. No error recovery guidance. Tool names are reasonable (verb_noun style) but lack the specificity needed for LLM disambiguation. Security concerns: no visible input validation, no permission gates on destructive ops (deleteDocument), no audit logging. Composition is reasonable (11 focused tools) but missing idempotency guarantees and batch operations.
Calcula similaridade de cosseno entre dois embeddings (Calculates cosine similarity between two embeddings)
Cadastra um novo documento no sistema (Registers a new document in the system)
Remove um documento do sistema (Removes a document from the system)
Gera embedding para um texto usando a API do Gemini (Generates embedding for text using Gemini API)
Obtém um documento por ID (Gets a document by ID)
Obtém estatísticas dos documentos (Gets document statistics)
Lista todos os documentos com filtros opcionais (Lists all documents with optional filters)
Processa uma pergunta e retorna uma resposta baseada nos documentos (Processes a question and returns an answer based on documents)
No formal JSON Schema input definitions visible. Parameters described in text (e.g., 'question' as string, 'options' as object) but lack explicit type, format, minLength, maxLength, enum constraints. LLMs cannot validate inputs or understand constraints from text alone.
No output schemas documented. Tools return responses (e.g., processQuestion returns 'success', 'response', 'confidence', 'documents') but LLMs have no formal schema to understand structure, required fields, or downstream chaining. Breaks tool composition.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 38 | 2026-07-28+ | v2 |
Reindexa todos os documentos reprocessando embeddings (Reindexes all documents by reprocessing embeddings)
Divide texto em chunks para processamento (Splits text into chunks for processing)
Atualiza um documento existente (Updates an existing document)
deleteDocument lacks confirmation or dry-run pattern. Destructive operation with no recovery guidance. No error handling shown for cascading deletes or permission checks. Agents can irreversibly delete documents without safeguards.
No visible input validation or error recovery guidance. Tools lack actionable error messages (e.g., 'Invalid document type: got "xyz", must be one of: lei, regulamento, servico, informacao'). Errors appear to be generic exceptions without LLM-friendly recovery hints.
No pagination or result limits documented for listDocuments. Large result sets could exhaust context windows. No mention of page/offset/limit parameters or total count in response.