Files
2nd/10_Wiki/Topic_General/From_Other/Improvisation.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

6.8 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-improvisation Improvisation 10_Wiki/Topics verified self
Improv
Adaptive Response
Spontaneous Decision-Making
none B 0.85 applied
meta
decision-making
agentic
exploration
2026-05-10 pending
language framework
python general

Improvisation

매 한 줄

"매 plan 의 die 매 first contact, 매 improv 매 take over". Improvisation 매 real-time adaptive decision-making 매 incomplete information 매 unfolding situation. 2026 LLM agents 매 nontrivial improv capability 의 exhibit — 매 tool failure / unexpected output 의 recover 가능.

매 핵심

매 Components of improv

  • Situation awareness: 매 current state 의 fast read.
  • Repertoire: 매 prelearned moves / patterns.
  • Risk gauge: 매 reversible vs irreversible 의 distinguish.
  • Commitment: 매 hesitation 의 X — 매 decide 의 act.

매 Plan vs Improv spectrum

  • Pure plan: scripted, deterministic, fragile.
  • Plan + improv: skeleton plan + adaptive details (best for most tasks).
  • Pure improv: jazz solo, emergency response.
  • 매 majority production system 매 plan-with-improv-edges.

매 LLM agent improvisation

  • 매 tool returns unexpected error → reformulate vs fail.
  • 매 user gives ambiguous instruction → ask vs guess vs proceed.
  • 매 token budget 매 exhaust → compress vs truncate vs delegate.

매 응용

  1. Incident response (production outage).
  2. Live coding session (pair programming).
  3. LLM agent error recovery.
  4. Customer support edge cases.

💻 패턴

Pattern 1: Repertoire of moves

from typing import Callable

class ImprovKit:
    """매 prelearned moves — 매 situation 의 match 의 dispatch."""
    def __init__(self):
        self.moves: dict[str, Callable] = {}

    def register(self, situation: str, move: Callable):
        self.moves[situation] = move

    def respond(self, context: dict):
        for situation, move in self.moves.items():
            if matches(situation, context):
                return move(context)
        return self.default_move(context)

    def default_move(self, context):
        return {"action": "ask_for_clarification"}

Pattern 2: Reversibility check before commit

def is_reversible(action: dict) -> bool:
    irreversible = {"delete_file", "send_email", "db_drop", "git_push_force"}
    return action["type"] not in irreversible

def improv_decide(action: dict, confidence: float) -> str:
    if is_reversible(action):
        return "act"  # 매 try 의 cheap
    if confidence > 0.95:
        return "act"
    return "pause_and_verify"

Pattern 3: LLM error recovery loop

def call_with_improv(client, prompt: str, max_retries: int = 3):
    history = [{"role": "user", "content": prompt}]
    for attempt in range(max_retries):
        try:
            return client.messages.create(
                model="claude-opus-4-7",
                max_tokens=2000,
                messages=history,
            )
        except RateLimitError:
            time.sleep(2 ** attempt)
        except OverloadedError:
            # 매 fallback 매 smaller model
            return client.messages.create(
                model="claude-haiku-4-7",
                max_tokens=2000,
                messages=history,
            )
        except Exception as e:
            history.append({
                "role": "user",
                "content": f"Previous attempt errored: {e}. Try a different approach.",
            })
    raise RuntimeError("매 improv 의 exhaust")

Pattern 4: Yes-and (improv principle)

def yes_and(user_input: str, context: dict) -> str:
    """매 improv 'Yes, and' — accept premise, build on it."""
    return f"Acknowledged: {user_input}. Building on this: {extend(user_input, context)}."

# 매 LLM system prompt 의 embed:
SYSTEM = """매 user 매 partial information 의 give. 매 yes-and 의 follow:
1. Accept what they said as fact (yes).
2. Add useful structure (and).
3. Avoid 'no, that's wrong' unless 매 hard contradiction."""

Pattern 5: Bounded improv (safety rail)

class BoundedImprov:
    def __init__(self, max_actions: int = 5, allowed_ops: set = None):
        self.max_actions = max_actions
        self.allowed_ops = allowed_ops or {"read", "search", "summarize"}
        self.actions_taken = 0

    def attempt(self, op: str, *args):
        if self.actions_taken >= self.max_actions:
            raise RuntimeError("매 budget exceed — escalate 의 human")
        if op not in self.allowed_ops:
            raise PermissionError(f"매 {op} 매 not in improv allowlist")
        self.actions_taken += 1
        return execute(op, *args)

Pattern 6: Postmortem of improv

def improv_log_entry(situation: str, move: str, outcome: str) -> dict:
    return {
        "ts": time.time(),
        "situation": situation,
        "move_chosen": move,
        "outcome": outcome,
        "would_repeat": outcome in ("success", "partial_success"),
        "alternatives_considered": [],
    }

# 매 weekly review 매 add successful patterns 의 ImprovKit.

매 결정 기준

상황 Approach
Reversible action, < 1min Pure improv.
Irreversible, high stakes Plan first — improv 의 X.
Ambiguous user request Yes-and + clarifying question.
LLM tool error Bounded retry + reformulation.
Production incident Plan (runbook) + improv on edges.

기본값: 매 80/20 — 80% plan, 20% improv 매 unforeseen edges. 매 irreversible 매 strict plan only.

🔗 Graph

🤖 LLM 활용

언제: Tool error recovery, ambiguous user input handling, edge cases not covered by training data, multi-turn agent self-correction. 언제 X: Compliance-critical workflow (deterministic pipeline only), safety-critical irreversible action.

안티패턴

  • Improv on irreversible action: 매 prod DB drop 의 wing 의 X.
  • No repertoire: 매 from-scratch every situation — slow + inconsistent.
  • No reversibility check: 매 acted 매 then-realized too late.
  • Ego improv: refuse 의 ask for help — 매 stuck-but-improv-ing.

🧪 검증 / 중복

  • Verified: Keith Johnstone "Impro" (1979), Karl Weick "Organizing for Reliability" (1987), OODA loop (Boyd).
  • 신뢰도 B (academic-soft + applied agentic literature).

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — full content with LLM agent improv patterns and reversibility framework