Posts

Showing posts with the label algoritma

9 proyek inovatif berbasis MCP (Model-Context-Protocol) untuk pengembangan sistem AI modern

📖 9 MCP-Based AI Engineering Projects: A Framework for Building Modular, Local, and Intelligent Agents 📚 Abstrak Model-Context-Protocol (MCP) adalah paradigma arsitektur modular yang memisahkan model AI, konteks input, dan protokol interaksi, memberikan fleksibilitas ekstrem dalam membangun sistem yang terlokalisasi, adaptif, dan dapat diskalakan. Dalam makalah ini, kami mendefinisikan sembilan proyek MCP strategis untuk AI Engineer yang ingin membangun solusi canggih seperti RAG multi-fallback, asisten analitik keuangan, dan agen riset lokal. Setiap proyek dianalisis dari aspek fungsional, arsitektural, serta potensi dampaknya. 1. 🔧 Build a Fully Local MCP Client Deskripsi Membangun arsitektur MCP secara self-contained tanpa koneksi ke cloud (offline). Model lokal (LLM, embedding, retriever), context layer, dan protocol routing dijalankan di satu mesin. Fitur Kunci Gunakan LLM open-source (Mistral, LLaMA, Gemma). Embedding & retrieval via faiss atau chromadb . ...

arsitektur Context Engineering secara menyeluruh, meliputi pipeline, matrix pendekatan, core principles, dan metrics evaluasi.

📖 Towards Robust Context Engineering Architecture: Framework, Patterns, Principles, and Metrics for LLM-Driven Systems 📚 Abstrak Model bahasa besar (LLM) seperti GPT dan Claude hanya dapat bekerja optimal bila didukung oleh context yang relevan, terstruktur, dan efisien. Context engineering merupakan pendekatan sistematis untuk merancang, menyaring, mengoptimalkan, dan menyampaikan konteks input kepada LLM. Artikel ini menyajikan kerangka arsitektur Context Engineering dalam bentuk pipeline lima tahap, klasifikasi strategi dalam bentuk matriks, prinsip-prinsip inti, serta metrik evaluasi yang dapat digunakan untuk membangun sistem LLM yang andal dan efisien. 1. 🧠 Pendahuluan Dalam paradigma Retrieval-Augmented Generation (RAG) dan agentic workflows, konteks adalah kunci. Namun, tanpa arsitektur context engineering yang tepat, sistem: Menjadi lambat karena context overload . Menghasilkan respons yang tidak akurat akibat context noise . Tidak skalabel karena tidak ef...

7 pola retrieval (retrieval patterns) paling umum digunakan dalam arsitektur RAG (Retrieval-Augmented Generation)

📖 Top 7 Retrieval Patterns dalam Arsitektur RAG: Studi Komparatif dan Aplikatif 📚 Abstrak Retrieval-Augmented Generation (RAG) telah menjadi paradigma penting dalam pengembangan sistem kecerdasan buatan berbasis bahasa, khususnya untuk meningkatkan kemampuan reasoning dan factual accuracy dari Large Language Models (LLMs). Komponen retrieval dalam RAG menentukan sejauh mana sistem dapat mengambil informasi yang relevan dari sumber eksternal. Dalam makalah ini, kami mengkaji tujuh pola retrieval terkemuka yang digunakan dalam sistem RAG modern, mengevaluasi kekuatan, kelemahan, serta kasus penggunaannya dalam aplikasi nyata. 1. 🧠 Pendahuluan Retrieval merupakan jantung dari sistem RAG karena memfasilitasi akses dinamis ke sumber informasi eksternal. Alih-alih mengandalkan memori internal model, retrieval menyediakan dokumen relevan yang digunakan sebagai konteks dalam proses generatif. Beberapa retrieval patterns telah berkembang sebagai respons terhadap tantangan seperti rele...

contoh kode lengkap RAG (Retrieval-Augmented Generation) menggunakan LangChain + OpenAI

contoh kode lengkap RAG (Retrieval-Augmented Generation) menggunakan LangChain + OpenAI , dengan sumber data dari dokumen lokal (misalnya file PDF atau teks). ✅ Tujuan Kita akan membuat chatbot yang bisa: Membaca dokumen lokal (misalnya artikel, laporan, PDF). Menyimpan representasi vektornya dalam vector database (FAISS). Saat ditanya, sistem akan: Melakukan retrieval dari dokumen, Lalu menghasilkan jawaban dengan OpenAI GPT. 🧱 Struktur Minimal rag-example/ ├── docs/ │ └── my_notes.txt ├── rag_app.py ├── requirements.txt 📦 1. Install Dependency pip install langchain openai faiss-cpu tiktoken Jika pakai PDF: pip install pypdf 🧠 2. rag_app.py – LangChain + OpenAI RAG App from langchain . document_loaders import TextLoader from langchain . text_splitter import RecursiveCharacterTextSplitter from langchain . vectorstores import FAISS from langchain . embeddings import OpenAIEmbeddings from langchain . chat_models import ChatOpenAI...

Pejuang Karier AI WAJIB TAHU APA ITU RAG (Retrieval-Augmented Generation)

 RAG (Retrieval-Augmented Generation) , sebuah teknik mutakhir dalam pengembangan sistem AI berbasis bahasa: 🧠 Apa Itu RAG (Retrieval-Augmented Generation)? RAG (Retrieval-Augmented Generation) adalah arsitektur pemrosesan bahasa alami (NLP) yang menggabungkan kemampuan pencarian informasi (retrieval) dengan kemampuan menghasilkan teks (generation) dalam satu model terpadu. Pendekatan ini dirancang untuk mengatasi keterbatasan model bahasa murni yang hanya mengandalkan ingatan internal (parameter model), dengan mengakses sumber eksternal secara dinamis saat menjawab pertanyaan atau menghasilkan teks . 📦 Komponen Utama dalam RAG RAG terdiri dari dua komponen besar: 1. Retriever (Pencari Dokumen) Fungsinya mirip dengan mesin pencari. Mencari dan mengambil dokumen atau potongan teks dari basis data eksternal (corpus) yang relevan dengan input pengguna . Biasanya menggunakan algoritma seperti Dense Passage Retrieval (DPR) atau BM25 . 2. Generator (Pembuat Jawa...

Introduction to Stopping Conditions

Image
Part B: Stopping Conditions Introduction In the preceding section, we introduced an algorithm designed to construct a decision tree. This algorithm incorporates a specific feature known as a  stopping condition.  Question: Question:  If we don’t terminate the decision tree algorithm manually, what will the leaf nodes of the decision tree look like? Show Answer Answer:  The tree will continue to grow until each leaf node contains  exactly one training point  and the model attains  100%  training accuracy. As you might remember from our previous course, 100% accuracy is a bad thing! It almost certainly means that we have overfit our data.  Question: Question:  How can we prevent this from happening? Show Answer Answer:  Stop the tree from growing. Common Stopping Conditions The most common stopping criterion involves restricting the  maximum depth  ( max_depth ) of the tree. The following diagram illustrates a decision tree ...

single line of input as a string and passing it to ArrayChallenge.

 Java code appears to be a solution to the ArrayChallenge problem, and it follows the recursive approach to check if any combination of numbers (excluding the largest number) can add up to the largest number in the array. However, there is a minor issue in your code that needs to be corrected. The ArrayChallenge method is defined to take an integer array as an argument, but in your main method, you are reading a single line of input as a string and passing it to ArrayChallenge . You should parse the input string to an integer array first. Here's the corrected version of your code: import java . util .* ; import java . io .* ; class Main {   public static boolean ArrayChallenge ( int [] arr ) {     // code goes here       int max = Integer . MIN_VALUE ;     int sum = 0 ;     for ( int num : arr ) {       if ( num > max ) {         max = num ;       }   ...

ChallengeToken concatenation and character replacement:

 String Challenge Have the function StringChallenge(sen) take the sen parameter being passed and return the longest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. Words may also contain numbers, for example "Hello world123 567" Once your function is working, take the final output string and concatenate it with your ChallengeToken, and then replace every fourth character with an underscore. Your ChallengeToken: 386emsol49 Examples Input: "fun&!! time" Output: time Final Output: tim_386_mso_49 Input: "I love dogs" Output: love Final Output: lov_386_mso_49 -------------------------------- Java code to implement the StringChallenge function as described, along with the ChallengeToken concatenation and character replacement: public class Main {     public static void main ( String [] args ) {         System . ...

Advanced Data Visualization in Python: Seaborn for Statistical Data Visualization

 Advanced Data Visualization in Python: Seaborn for Statistical Data Visualization 1. Overview of Seaborn Seaborn is a Python data visualization library built on top of Matplotlib, designed specifically for creating attractive and informative statistical graphics. It provides a high-level interface for drawing plots that are easy to interpret and useful for exploring and understanding data. Seaborn integrates well with Pandas, allowing users to create complex visualizations with minimal code, making it a preferred choice for statistical data analysis. 2. Key Features of Seaborn Built-in Themes : Seaborn comes with several built-in themes for styling Matplotlib graphics, which enhances the aesthetics of plots without the need for extensive customization. Statistical Estimation : Seaborn has functions like sns.barplot and sns.pointplot that perform statistical estimation while plotting. For instance, it can automatically compute confidence intervals for a given dataset. Complex ...