# LangGraph Complete Study Notes
## 1. Core Concepts
### What is LangGraph?
- **Stateful graph framework** for building complex LLM workflows
- **Cyclic graphs** - supports loops and conditional flows
- **Built on LangChain** - integrates seamlessly with LCEL
- **Persistence** - save and resume workflows at any point
### Graph Types
- **StateGraph** - Main graph with typed state (most common)
- **MessageGraph** - Specialized for chat messages
- **WorkflowGraph** - Simple workflow# LangChain
llms_chat_model, prompts,output_parsers, memory, chains, messages.py", rag_retrievers,
embedding, retrievers, runnables, callbacks, text_splitter, tools_toolkits, document_loader,
streaming.py", mcp_client,
# LangGraph
state, nodes, edges, checkpointer", persistence", workflows
# Langchain all important technique names
# LangChain Essential Techniques Reference
## 1. Prompts (Core Techniques)
### Must-Know
- **ChatPromptTemplate** - Primary template fo# Notes
- Combine chat history and notes into a single markdown file.
- Note: Do not include unnecessary objects.
- Revise the notes file for a short, clear read.
- Correct only the prompt wording.
## List client
ls /etc/openvpn/easy-rsa/pki/issued/
## Delete client
su
cd /etc/openvpn/easy-rsa/
./easyrsa revoke client_to_delete
./easyrsa gen-crl
cp /etc/openvpn/easy-rsa/pki/crl.pem /etc/openvpn/
chmod 644 /etc/openvpn/crl.pem
systemctl restart openvpn
openssl crl -in /etc/openvpn/crl.pem -noout -text | grep -A1 "Revoked Certificates"
## Add client
./ubuntu-22.04-lts-vpn-server.sh
## Check certif expired
openssl x509 -in /etc/openvpn/easy-rsa/pki/issued/server_*.crt -text -noE STUDY THE RULES AND PUT THE DIRECT SPEECH INTO REPORTED SPEECH STARTING WITH "SHE SAID..." REPORTED SPEECH
1. "I’ve had better results than any other student on the program."
She said, she had had better results...
2. "I saw you stealing money from the charity box and I’m going to report it right now."
She said, she had seen you stealing money and she was going to report it right then
3. "We should do a sponsored run to raise money tomorrow."
She said, we should do a sponsored run to def generate_correlation_report(df: pd.DataFrame, output_path: str = None) -> dict:
"""
Generates a correlation metrics report:
1. Strong correlations (>|0.80|)
2. Very weak correlations (< 0.01)
Optionally saves the report as JSON.
Parameters
----------
df : pd.DataFrame
Input dataframe.
output_path : str, optional
File path to save JSON report.
Returns
-------
dict
Correlation summary report.
"""
import json
import os
from typing import Any, Dict
from datetime import datetime
class SaveJsonException(Exception):
"""Custom exception for JSON saving errors."""
pass
def save_json(data: Dict[str, Any], file_path: str) -> None:
"""
Save dictionary data to a JSON file with full reliability.
Key Capabilities:
-----------------
• Creates directories automatically
• Supports UTF-8 encoding
• Atomic write operation (prevents corruptiW3SCHOOLS
https://www.w3schools.com/bootstrap5/index.php
• Grids
https://www.w3schools.com/bootstrap5/bootstrap_grid_basic.php• https://github.com/jqueryscript/Bootstrap-5-Design-ResourcesSome of the best free options
• Lightbox for Bootstrap 5 (a.k.a. bs5-lightbox): This is a pure JavaScript lightbox gallery plugin specifically designed for Bootstrap 5. It leverages Bootstrap's Modal and Carousel components, ensuring a consistent look and feel with your existing Bootstrap 5 project. Listed in Bootstrap 5 Design Resources (see below).
• Chocolat: A free, lightweight, and responsive lightbox plugin that offers flexibility in how images are displayed (fullscreen or within a contain/**
* @param {number[]} nums
* @return {number}
*/
var minimumOperations = function(nums) {
// Initialize a counter to keep track of total operations
let operations = 0;
// Loop through each number in the array
for (let num of nums) {
// Find the remainder when divided by 3
let remainder = num % 3;
// If remainder is 1, subtract 1 -> costs 1 operation
// If remainder is 2, add 1 -> costs 1 operation
// If remainder is 0, no operation nimport torch
import torch.nn as nn
import torch.nn.functional as F
# --------------------------------------------------------------------
# 1. Syntactic Mapping Layer
# --------------------------------------------------------------------
class SyntacticMapping(nn.Module):
"""
Implements:
- syntactic relation matrix S (eq.4)
- adjacency g(i,j) (eq.5)
- syntactic similarity (eq.6)
- word-level syntactic embedding (eq.7)
"""
def __init__(self, eimport torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------
# Basic Modules: MLP, Attention, Transformer blocks
# ---------------------------------------------------------
class MLP(nn.Module):
def __init__(self, dim, hidden):
super().__init__()
self.fc1 = nn.Linear(dim, hidden)
self.fc2 = nn.Linear(hidden, dim)
self.act = nn.GELU()
def forward(self, x):
return # curl コマンド一覧
## curlとは
curlは、コマンドラインからHTTPリクエストを送信するツール。Webブラウザが行うHTTPリクエストを、ターミナル上で実行できる。
### 基本動作
- HTTPプロトコルでサーバーにリクエストを送信
- サーバーからのレスポンスを標準出力に表示
- GET、POST、PUT、DELETE等のHTTPメソッドに対応
- JSON、XML、HTML等の任意のデータ形式を送受信可能
### 用途
- API動作確認
- Webサーバーの状態チェック
- ファイルダウンロード
- 自動化スクリプトでのHTTP通信
- パフォーマンス測定
### インストール
macOS: 標準でインストール済み
Windows 10/11: 標準でインストール済み
Linux: `apt install curl` 等でインストール
### 基本構文
```bash
curl [オプション] URL
```
### 最も基本的な使用例
```bash
# GETリクエスト(最もシンプル)
curl https://jsonplaceimport torch
import torch.nn as nn
import torch.nn.functional as F
# ==========================================================
# Basic building blocks
# ==========================================================
class ConvBNReLU(nn.Module):
"""Basic conv → BN → ReLU"""
def __init__(self, in_ch, out_ch, k=3, s=1, p=1):
super().__init__()
self.conv = nn.Conv2d(in_ch, out_ch, k, s, p, bias=False)
self.bn = nn.BatchNorm2d(out_ch)
self.act = from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Dict, Any, Tuple
import torch
from torch import nn
from torch.nn import functional as F
# ---------------------------------------------------------------------------
# Utility modules
# ---------------------------------------------------------------------------
class MLP(nn.Module):
"""Simple multi-layer perceptron with optional dropout and activation."""
def __init_