Files
2nd/10_Wiki/Topic_Programming/Architecture/Belief-System.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

5.7 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-belief-system Belief System 10_Wiki/Topics verified self
Belief System
Agent Belief
Knowledge Base
BDI Beliefs
none A 0.85 applied
agent-architecture
ai
bdi
knowledge-representation
2026-05-10 pending
language framework
python bdi,langchain,owl-rdf

Belief System

매 한 줄

"매 agent 의 'world 가 such-and-such' 의 internal model — 매 perception update · inference 로 부터 의 derive". Bratman 1987 BDI (Belief-Desire-Intention) 의 origin, 2026 의 LLM agent 의 working memory · scratchpad · long-term memory store 의 modern incarnation.

매 핵심

매 component

  • Belief base: fact set (logical · probabilistic · embedding-vector).
  • Update rule: perception → belief revision (AGM postulates).
  • Query interface: 매 plan 의 condition 의 check.
  • Consistency check: contradiction 의 detect · resolve.

매 representation

  • Symbolic: Prolog · Datalog · OWL/RDF.
  • Probabilistic: Bayesian network · Markov logic.
  • Vector/embedding: 매 modern LLM agent — chunked text + embedding store.
  • Hybrid: structured fact + free-text (most 2026 agent system).

매 응용

  1. 매 BDI agent (JADE · Jadex · Jason).
  2. Robot world model (ROS knowledge_base).
  3. LLM agent scratchpad (Claude · LangGraph state).

💻 패턴

BDI-style belief base (Python)

from dataclasses import dataclass, field
from typing import Any

@dataclass
class BeliefBase:
    facts: dict[str, Any] = field(default_factory=dict)
    confidence: dict[str, float] = field(default_factory=dict)

    def add(self, key: str, value: Any, conf: float = 1.0):
        if key in self.facts and self.facts[key] != value:
            # contradiction → keep higher-confidence
            if conf <= self.confidence[key]: return
        self.facts[key] = value
        self.confidence[key] = conf

    def query(self, key: str) -> tuple[Any, float] | None:
        if key not in self.facts: return None
        return self.facts[key], self.confidence[key]

bb = BeliefBase()
bb.add("door_open", True, 0.9)
bb.add("battery_pct", 73, 1.0)

LLM agent: belief 의 prompt-injected scratchpad

def build_prompt(beliefs: BeliefBase, task: str) -> str:
    facts = "\n".join(
        f"- {k}: {v} (conf={c:.2f})"
        for k, (v, c) in [(k, (bb.facts[k], bb.confidence[k])) for k in bb.facts]
    )
    return f"""You are an agent with the following beliefs:
{facts}

Task: {task}
Plan your next action and explain reasoning."""

Bayesian belief update (sensor fusion)

def bayes_update(prior: float, likelihood: float, evidence: float) -> float:
    """P(H|E) = P(E|H) * P(H) / P(E)"""
    return likelihood * prior / evidence

# Door 의 open 의 prior 0.5, sensor 의 reading "open" 의 likelihood 0.9, evidence 0.6
posterior = bayes_update(0.5, 0.9, 0.6)  # 0.75

Vector belief store (long-term memory)

import chromadb

client = chromadb.PersistentClient("./agent_memory")
beliefs = client.get_or_create_collection("beliefs")

beliefs.upsert(
    ids=["b-001"],
    documents=["User prefers vegetarian restaurants in 5km radius"],
    metadatas=[{"source": "user_pref_2026-04-12", "conf": 0.95}],
)

hits = beliefs.query(query_texts=["restaurant recommendation"], n_results=5)

Belief revision (AGM contraction)

def contract(bb: BeliefBase, fact: str):
    """Remove fact + minimal additional facts to restore consistency."""
    if fact in bb.facts:
        del bb.facts[fact]
        del bb.confidence[fact]
    # Naive — production uses entrenchment ordering

LangGraph stateful belief

from langgraph.graph import StateGraph
from typing import TypedDict

class AgentState(TypedDict):
    beliefs: dict
    desires: list[str]
    intentions: list[str]

def perceive(state: AgentState) -> AgentState:
    state["beliefs"]["weather"] = call_weather_api()
    return state

graph = StateGraph(AgentState).add_node("perceive", perceive)

매 결정 기준

상황 Representation
매 deterministic rule-based Datalog · Prolog
Uncertain sensor data Bayesian network
Open-domain text · LLM agent Vector embedding + scratchpad
Robot · spatial Probabilistic occupancy grid + KB
Multi-agent · negotiation KQML · FIPA + symbolic KB

기본값: hybrid — symbolic skeleton (key fact 의 dict) + vector store (free-text long-term).

🔗 Graph

🤖 LLM 활용

언제: belief base 의 natural-language form 의 store (e.g. user preference summary), scratchpad 의 reasoning step 의 record. 언제 X: 매 safety-critical inference (medical · industrial) — LLM 의 hallucinate · 매 symbolic verifiable 의 require.

안티패턴

  • No revision policy: belief 의 add-only — contradictory state 의 accumulate.
  • Confidence 의 ignore: 매 fact 의 binary present/absent — sensor noise 의 not handle.
  • Global belief blob: 매 agent 의 share — privacy · ownership 의 unclear → BDI per-agent KB.
  • Vector-only memory: 매 deterministic recall (e.g. "what is user's name") 의 unreliable — symbolic key/value 의 mix.

🧪 검증 / 중복

  • Verified (Bratman 1987, AGM 1985, FIPA agent specs, LangGraph docs, ChromaDB docs).
  • 신뢰도 A-.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — BDI + 2026 LLM hybrid (vector + symbolic)