AI Lead Qualifier
Transforme cada consulta recebida em JSON pontuado e pronto para o CRM com o Claude.
- Python
- FastAPI
- Pydantic
- Anthropic Python SDK
- Uvicorn
Capturas de tela
Pagamento único
- ₹ 1.499+ GST no pagamento
- US$ 29
- Baixe na sua biblioteca assim que o pagamento for confirmado.
- Todas as versões futuras deste projeto estão incluídas, sem custo adicional.
- Versão mais recente
- 1.0.0 · 14 de out. de 2026
- Licença
- Source Code Licence
Visão geral
Um serviço enxuto em Python e FastAPI que envia uma consulta comercial curta para a API do Claude e devolve JSON estruturado: os dados principais, a intenção, uma pontuação de 0 a 100 com prioridade e os motivos, um resumo curto e uma resposta sugerida, pronto para ir para o seu CRM.
Separar consultas manualmente é lento, e os bons leads esperam enquanto alguém lê spam. O AI Lead Qualifier faz essa primeira triagem por você. Envie uma consulta para um único endpoint da API e receba JSON limpo e estruturado em poucos segundos.
O Claude extrai o nome, o e-mail, o telefone, a empresa, o cargo, a localização, o orçamento, o prazo e os requisitos do remetente exatamente como foram escritos. Nada é inventado: o que a mensagem não diz volta como null. Ele classifica a intenção como consulta comercial, pedido de suporte, parceria, candidatura a vaga, oferta de fornecedor, spam ou outra, escreve um resumo de uma ou duas frases e redige uma resposta assinada com o nome da sua empresa para uma pessoa revisar antes de enviar.
A pontuação é calculada em Python, não pelo modelo. Uma tabela de pontuação transparente transforma os sinais que o Claude encontra (orçamento, urgência, poder de decisão, uma necessidade específica, um pedido de reunião) em uma pontuação de 0 a 100, uma prioridade alta, média ou baixa e uma lista de motivos como "+20 Budget mentioned". As pontuações são consistentes, explicáveis e fáceis de ajustar, e nenhuma mensagem consegue se convencer a chegar à prioridade alta. As consultas são tratadas como dados, nunca como instruções, então tentativas de injeção de prompt são classificadas em vez de obedecidas.
Está pronto para produção. Os resultados sempre seguem o esquema graças às saídas estruturadas do Claude. Cada problema com a API do Claude vira um status HTTP claro (422, 502, 503 ou 504) com um ID de requisição, e os logs registram intenção, pontuação, tokens e duração sem nenhum dado de cliente. O prompt de sistema fica em cache para reduzir custos, e você pode trocar o modelo do Claude e o nível de esforço em um único arquivo de configuração.
O código é pequeno, tipado e totalmente testado. 39 testes do pytest rodam em menos de um segundo com um analisador falso, então nunca chamam o Claude e não custam nada. Adapte o prompt, os campos extraídos ou a tabela de pontuação ao seu negócio em arquivos bem identificados.
Quer ver como foi construído? A série gratuita de tutoriais passo a passo "Build an AI Lead Qualification Agent with Claude and Python" (em inglês) percorre cada arquivo deste projeto: https://devblogs.dewiride.com/series/claude-api/ai-lead-qualification-agent-claude-python (abre em uma nova aba)
Série de tutoriais gratuita
Build an AI Lead Qualification Agent with Claude and Python
Prefere aprender construindo? Este guia gratuito e passo a passo no nosso blog mostra como o projeto é feito.
O que você leva
Tudo o que está no arquivo, em um relance.
- Código-fonte completo em Python da versão 1.0.0
- Um app FastAPI com um endpoint, POST /api/v1/leads/qualify, e uma verificação de saúde
- Saídas estruturadas do Claude baseadas em modelos Pydantic
- Uma tabela de pontuação transparente de 0 a 100 com prioridade e motivos, calculada em Python
- Respostas de erro claras (422, 502, 503, 504) com ID de requisição em toda resposta
- Logs seguros com uso de tokens e sem dados de clientes
- Um prompt de sistema em cache que você edita em um único arquivo Markdown
- 39 testes do pytest offline que nunca chamam a API do Claude
- uv.lock com as versões exatas dos pacotes usadas nos testes
- Um README com instalação, configuração, referência da API e guia de personalização
- Um modelo .env.example para cada configuração
Feito com
As versões e os ambientes exatos com que foi criado e testado.
- Python3.14
- FastAPI0.143.0
- Pydantic2.14.1
- Anthropic Python SDK1.13.0
- Uvicorn0.54.0
- pytest9.1.1
O que há no arquivo
A árvore de pastas que você recebe ao descompactar.
ai-lead-qualifier/
- src/
- lead_qualifier/
- __init__.py
- main.py
- config.py
- models.py
- prompts.py
- system_prompt.md
- analyzer.py
- scoring.py
- logging_config.py
- api/
- __init__.py
- health.py
- leads.py
- errors.py
- middleware.py
- lead_qualifier/
- tests/
- conftest.py
- test_api.py
- test_models.py
- test_prompts.py
- test_scoring.py
- data/
- greenleaf-analysis.json
- .env.example
- .gitignore
- .python-version
- pyproject.toml
- uv.lock
- README.md
O que ele precisa de você
As contas e os serviços que ele espera encontrar, para nada surpreender.
- uv, que instala o Python 3.14 para você
- Uma chave da API do Claude em uma conta da Anthropic com créditos (o uso da API é cobrado pela Anthropic)
- Familiaridade básica com comandos no terminal
- macOS, Windows ou Linux
Versões
Todas as versões até agora, da mais recente para a mais antiga.
1.0.0Mais recente
Primeira versão. Envie uma mensagem curta de um lead para um endpoint da API e receba JSON pronto para o CRM: os dados de contato mencionados, a intenção, uma pontuação de 0 a 100 com prioridade e motivos em linguagem simples, um resumo curto e uma resposta sugerida. Inclui respostas de erro claras, IDs de requisição, logs sem dados pessoais e um conjunto completo de testes que roda sem chamar a API do Claude.
Source Code Licence
O que você pode fazer com ele
What you may and may not do with the source code you buy.
Ler a licença completa
- What this licence covers
This licence governs every file included in a product you buy from Dewiride Store: source code, configuration, database scripts, sample data, documentation and any other file in the download. It takes effect when your payment is confirmed and applies to every release of that product that reaches your library. Files that reach your library through an annual updates membership are governed in exactly the same way.
It forms part of the Terms of Sale and Use. Where a product page states different or additional licence terms for that product, those terms prevail for that product. The membership page may likewise state different or additional licence terms for the files a membership carries, and those terms then prevail for those files.
- The licence we grant you
We grant you a perpetual, worldwide, non-exclusive, non-transferable licence to use, reproduce, adapt, translate and modify the files, and to include the result in your own work, on the conditions set out below.
Perpetual means it does not expire. Worldwide means it is not limited to any country. Non-exclusive means we license the same product to other customers. Non-transferable means you cannot pass it on to someone else.
The licence is granted to you — either you personally, or the organisation you identified when buying. Everyone working within that organisation may use the files for that organisation’s projects. Nobody outside it may.
- What you may do
- Use and change the files in your own projects, commercial or otherwise, with no limit on the number of projects.
- Build a product or a service on them and charge your own customers for it.
- Deploy the result for a client, as part of work you are doing for that client.
- Distribute the result in compiled, deployed or otherwise non-source form.
- Keep as many back-up copies as you reasonably need.
- Study, observe and test how the code works, and obtain the information you need to make it work with your own software.
The last two are yours by law under sections 52(1)(aa) to (ac) of the Indian Copyright Act, 1957, and nothing in this licence is intended to take them away.
- What you may not do
- Resell, sublicense, redistribute or publish the files themselves, in whole or in substantial part, in source form.
- Include them in a template, starter kit, course, tutorial repository or component library that you sell or give away, where the code is the thing being supplied.
- Share your account, your download links or your invoices with anyone outside your organisation.
- Publish the files in a public repository, or in any other place where they can be obtained without buying them.
- Remove or obscure the copyright and attribution notices in the source files.
- Use the files to build something whose main purpose is to compete with Dewiride Store as a supplier of the same code.
The distinction that matters is simple: you may sell what you build with the code; you may not sell the code.
- Third-party components
Our products depend on open-source libraries, frameworks and services that we did not write. Those remain under their own licences, which we do not and cannot change. Where a product includes or requires such a component, its licence is named in the product’s documentation, and complying with it is your responsibility.
- Releases
Every release of a product you own is covered by this same licence and appears in your library at no extra cost. A release you have already downloaded remains licensed to you even if we later stop publishing the product. A release that reached your library through an annual updates membership is licensed to you on these same terms, and stays licensed after the period that carried it has ended.
- Ownership
We keep ownership of the files and of the copyright in them. You own whatever you create with them: your changes, your additions and the product you build are yours.
- If this licence ends
This licence ends if you materially breach it and do not put the breach right within thirty days of us asking you to in writing. It also ends if your payment is reversed or refunded, because the purchase it depends on no longer stands. Where a membership period is refunded or reversed, the licence ends for the releases that period carried and for nothing else: anything you bought separately, or that another period carried, is unaffected.
If it ends, you must stop using the files and delete the copies you hold. Work you had already delivered to a client before that point may continue in use, so that ending this licence never breaks something your own customer relies on.
- No warranty beyond the description
The warranties and limits in section 19 and section 20 of the Terms of Sale and Use apply to this licence as well.
- Governing law
This licence is governed by the law of India, and section 24 of the Terms of Sale and Use applies to any dispute about it. If a translation and the English version differ in meaning, the English version governs.
AI Lead Qualifier
- ₹ 1.499+ GST no pagamento
- US$ 29