Back to Projects

Internal R&D project

Lead Intelligence

An AI-powered internal lead intelligence assistant using LangChain, RAG, vector retrieval, and structured LLM analysis to turn raw prospect information into contextual sales insights and personalized outreach.

AI Sales IntelligenceLive demo
AestheTeQs Lead Intelligence

Introduction

Project Overview

AestheTeQs Lead Intelligence is an internal AI application built to make outbound sales research more intelligent and more closely aligned with AestheTeQs' actual capabilities.

Instead of sending raw prospect information directly to an LLM and asking it to generate generic sales copy, the application uses LangChain-based orchestration and retrieval-augmented generation to provide the model with relevant AestheTeQs portfolio context before producing its analysis.

A lead profile can be submitted to the application, processed through an API route, analyzed against an internal portfolio knowledge base, and matched with the projects and services most relevant to that prospect.

The implementation creates LangChain documents from AestheTeQs project data and performs similarity retrieval against that knowledge before generating the final result. In one recorded workflow, the system loaded five portfolio projects, converted them into LangChain documents, built a memory vector store, and retrieved the three most relevant results for the supplied lead.

The project was built as an internal experiment in LangChain, RAG, embeddings, structured AI outputs, prompt engineering, sales intelligence, and AI-assisted business development.

Mechanism

Project Description

The challenge

Generic AI-generated outreach frequently suffers from the same problem: the model knows something about the prospect but does not know enough about what the seller can genuinely offer. This can produce recommendations that sound polished but have little connection to the company's actual capabilities.

AestheTeQs needed an internal experiment that could answer a more useful question: which of our actual projects, capabilities, and technical services are most relevant to this specific prospect, and how should that influence our outreach?

The solution

Lead Intelligence introduces a retrieval step before generation.

Lead Information
       ↓
Validation
       ↓
Portfolio Retrieval
       ↓
Vector Similarity Search
       ↓
Relevant AestheTeQs Context
       ↓
LangChain + LLM
       ↓
Structured Lead Analysis
       ↓
Personalized Outreach Insight

The system's internal portfolio knowledge includes projects such as MappingClarity, Review Engine, ApplyIQ, Halo Solutions, and CheckThisProperty.

For example, the retrieval layer can recognize ApplyIQ as relevant to recruitment and automation use cases because its portfolio metadata describes job scraping, CV tailoring, ATS-friendly document generation, n8n automation, and application tracking. This grounds the AI analysis in what AestheTeQs has actually built.

Primary Industry

AI Sales Intelligence / Business Development Automation. Relevant areas include:

B2B Sales
Lead Intelligence
AI Assistants
Sales Enablement
Business Development
RAG Applications
LLM Automation
Personalized Outreach

Roles

Who the End Users Are

Business development teams

Users evaluating whether a prospect is aligned with the company’s capabilities.

Founders & sales leaders

Decision-makers who need to quickly understand where a potential opportunity overlaps with past work.

Outreach specialists

Users preparing personalized LinkedIn or email outreach based on prospect context.

Software & AI agencies

The same architectural pattern can be adapted for agencies that need AI to understand their portfolio before recommending services to prospects.

Core Features

Lead Profile Analysis

The application accepts substantial prospect information and validates it before analysis. A captured development run shows the /api/analyze-lead route receiving and validating lead input before invoking the analysis pipeline.

Retrieval-Augmented Generation

Portfolio information is retrieved before LLM generation rather than relying entirely on model memory.

Portfolio-Aware Recommendations

The AI evaluates leads with relevant AestheTeQs project context available to it.

Vector Similarity Search

Project descriptions are transformed into documents and searched for semantic similarity.

Top-K Context Retrieval

The system retrieves the most relevant portfolio entries rather than sending the entire knowledge base indiscriminately.

Structured AI Output

The LangChain workflow initializes a structured model before invoking the analysis chain, helping constrain outputs to the expected format.

Local LLM Experimentation

Development used LangChain’s Ollama integration and local model tooling, providing practical experience with local-model orchestration as well as hosted AI architectures.

Contextual Outreach Assistance

The broader objective is to generate lead insights and personalized outreach grounded in portfolio relevance — a LangChain-based lead-analysis assistant using local LLMs, portfolio retrieval, structured outputs, prompt iteration, logging, and validation.

Technologies Used

TechnologyPurpose
Next.js 15Full-stack application framework
LangChain JSLLM orchestration and retrieval pipeline
Ollama / Local LLMLocal model experimentation
Ollama EmbeddingsSemantic representation
MemoryVectorStoreIn-memory vector retrieval
RAGPortfolio-grounded generation
JavaScript / TypeScriptApplication development
Next.js API RoutesLead-analysis endpoint
NetlifyPublic demonstration deployment

The development environment shows Next.js 15.5.19 and a dedicated /api/analyze-lead endpoint.

Architecture Overview

                    Lead Profile
                         │
                         ▼
                   Next.js UI
                         │
                         ▼
              /api/analyze-lead
                         │
                         ▼
                 Input Validation
                         │
                         ▼
               Portfolio Knowledge
                         │
                         ▼
               LangChain Documents
                         │
                         ▼
                    Embeddings
                         │
                         ▼
                MemoryVectorStore
                         │
                         ▼
               Similarity Retrieval
                         │
                         ▼
               Relevant Portfolio
                         │
                         ▼
                LangChain + LLM
                         │
                         ▼
               Structured Analysis

This is a compact but genuine RAG pipeline, not simply an LLM prompt behind a textbox.

Security & Data Handling

The application validates incoming lead-analysis requests at its API boundary. Separating AI execution into a server-side API route also prevents core AI orchestration logic from being implemented directly in browser code.

API-boundary validation of lead-analysis requests
Server-side AI orchestration, not browser-side
Controlled environment configuration
Limited, curated knowledge sources
Structured output validation
Avoiding unnecessary persistence of externally supplied prospect information

Deployment & Infrastructure

The demonstration application is deployed to Netlify at aestheteqs-lead-intelligence.netlify.app. The project architecture was developed with Next.js while its AI pipeline was tested independently of the frontend through the analysis API.

Source Code
    ↓
Next.js Build
    ↓
Netlify
    ↓
Lead Intelligence App
    ↓
/api/analyze-lead  →  LangChain + LLM

Platform Scale

The current internal knowledge base demonstrated retrieval across five AestheTeQs projects, with the pipeline dynamically selecting the most relevant subset for each lead.

More importantly, the architecture can scale beyond five projects by expanding the underlying knowledge source without fundamentally changing the lead-analysis workflow.

Lead → embeddings → portfolio retrieval → relevant context
    → structured AI reasoning → actionable sales intelligence
Next.jsLangChainRAGVector SearchOllamaAI/LLMNetlify

Internal R&D. Lead Intelligence is an internal engineering project rather than a client deployment. What it demonstrates is the retrieval step before generation — grounding an LLM in a real portfolio so its recommendations reflect capabilities the company actually has.