Generative AI and LLM in PHP | Ashish Tiwari | Laracon India 2025

Laracon 2024

🎤 Talk Summary: No-Code RAG Chatbot with PHP, LLMs & Elasticsearch Speaker: Ashish Diwali (Senior Developer Advocate, Elastic) 🔑 Introduction Topic: Integrating Generative AI (LLMs) with PHP. Goal: Show how to build chat assistants, semantic search, and vector search without heavy ML expertise. Demo focus: Using Elasticsearch + PHP + LLM (LLaMA 3.1). 🧩 Core Concepts 1. Prompt Engineering LLMs generate responses based on prompts → predicting next words. Techniques: Zero-shot inference → direct classification or tagging. One-shot inference → provide one example in the prompt. Few-shot inference → multiple examples → useful for structured outputs (SQL, JSON, XML). Iteration + context = In-context learning (ICL). 2. LLM Limitations ❌ Hallucinations (wrong answers). ❌ Complex to build/train from scratch. ❌ No real-time / private data access. ❌ Privacy & security concerns (especially in banking, public sector). 3. RAG (Retrieval-Augmented Generation) Solution to limitations. Workflow: User query → hits database/vector DB (e.g., Elasticsearch). Retrieve top 5–10 relevant docs. Pass as context window → LLM generates accurate answer. Benefits: Grounded responses. Works with private data. Avoids retraining large models. 🔍 Semantic & Vector Search Semantic Search: Understands meaning, not just keywords. Example: “best city” ↔ “beautiful city.” Vector Search: Text, images, and audio converted into embeddings (arrays of floats). Enables image search, recommendation systems, music search (via humming). Similarity algorithms: cosine similarity, dot product, nearest neighbors. 🛠️ Tools & Demo Elephant Library (PHP) Open-source PHP library for GenAI apps. Supports: LLMs: OpenAI, Mistral, Anthropic, LLaMA. Vector DBs: Elasticsearch, Pinecone, Chroma, etc. Features: document chunking, embedding generation, semantic retrieval, Q&A (RAG). Demo Flow Ingestion: ...

August 25, 2025 · 2 min · Ashish Tiwari
Privacy-First Conversation: Building No-Code Chat Assistants With ElasticSearch And Amazon Bedrock

AWS Community Day Mumbai 2024

🚀 No-Code Chatbot with Elasticsearch + AWS Bedrock (Talk Summary) Speaker: Ashish (Senior Developer Advocate, Elastic) Event: AWS Community Day Mumbai 2024 🔑 Why Search Still Matters with LLMs LLMs (like ChatGPT) are powerful but face: ❌ Hallucinations 💰 High cost per query 🔒 No access to private / real-time data ✅ Search grounds LLMs in reliable, domain-specific info. ⚡ Elasticsearch Capabilities Traditional keyword search + modern vector search. Real-world use cases: 📍 Geospatial queries (ride-sharing, food delivery) ❤️ Matchmaking 📊 Observability dashboards 📝 Centralized logging (Elastic Stack: Elasticsearch, Kibana, Beats, Logstash) 🤖 Retrieval-Augmented Generation (RAG) Workflow: ...

August 25, 2025 · 1 min · Ashish Tiwari
Serverless Ahmedabad 2023: Monitoring serverless environment with Elastic observability

Serverless Ahmedabad 2023: Monitoring serverless environment with Elastic observability

Introduction Serverless architectures take on-demand tasks to the next level with event-driven scheduling of workloads. Elastic Observability gives you the same insights into your serverless activities as the rest of your environment. Gather logs and metrics from your serverless invocations and tie them together with traces from your serverless functions. For example Identify AWS Lambda latency issues, cold starts, and other invocation issues. Logs are collected with the rest of your telemetry data, so you can look at all your data in context, in one place. ...

June 3, 2024 · 1 min · Ashish Tiwari
GIDS 2024 - Smart Search with RAG: Elasticsearch Meets Language Models

GIDS 2024 - Smart Search with RAG: Elasticsearch Meets Language Models

Introduction In today’s data-driven world, just having a search engine is not enough; the key is making it smart. Enter Elasticsearch Relevance Engine (ESRE) augmented with Retrieval Augmented Generation (RAG), a powerful solution that marries Elasticsearch’s superior search capabilities with Large Language Models (LLMs) like ChatGPT for precise, contextual querying over proprietary datasets. This session is a hands-on guide that will show you how to amplify the power of Elasticsearch with advanced LLMs. ...

June 3, 2024 · 1 min · Ashish Tiwari

Setup & Observe Kubernetes cluster

Introduction In this gist we will quickly spin a sample Kubernetes cluster and deploying the nginx pod. Additionally, we will implement monitoring using Elastic. Setup K8s cluster Cluster architecture 3 Node cluster Machine - Centos7, 4GB RAM kube1.local - Control plane node kube2.local - worker node kube3.local - worker node Here I am setting hostname kube1.local, kube2.local, kube3.local. Login into all of the servers and perform below command on all three nodes. ...

March 28, 2024 · 3 min · Ashish Tiwari