> ## Documentation Index
> Fetch the complete documentation index at: https://epistemicme.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Philosophy

> Understanding philosophies and their role in self-models

## Philosophy

A Self-Model can use a Philosophy to conceptualize a Belief System and to contextualize Dialectics.

A Philosophy is represented as a type of Observation Context that contextualizes epistemic Observation Contexts, ie, wraps the Observation Contexts in a Belief System.

### Purpose

Philosophies serve as a specific epistemology and optional ontology that act as filters, or a lens, across different events that a user receives and in turn are used to update a user's belief model.

Philosophies also serve to engage the user in dialectic based upon their current belief system. Philosophies are often written by a developer themselves or can be chosen from a catalog of existing Philosophies.

### The Default Philosophy

The Default Philosophy is automatically attached to a Self-Model when it is created. It provides observation contexts for three core categories:

* **Teleological Context**: A set of beliefs that provide assumptions about the Self-Models properties of becoming
* **Metaphysical Context**: A set of beliefs that provide assumptions about the Self-Models' being
* **Epistemic Context**: A set of beliefs that provide assumptions about the Self-Models internal world model

### Python SDK Usage

#### Create a Philosophy

```python theme={null}
import epistemic_me
philosophy = epistemic_me.Philosophy.create(
    description="# My Philosophy\n\n## Narrative\n[[C: Context1]] [[S: state1]] → [[S: state2]]",
    extrapolate_contexts=True
)
```

#### Update a Philosophy

```python theme={null}
updated = epistemic_me.Philosophy.update(
    philosophy_id=philosophy["philosophy"]["id"],
    description="# Updated Philosophy\n\n## Narrative\n[[C: Context2]] [[S: state3]] → [[S: state4]]",
    extrapolate_contexts=False
)
```

#### Add a Philosophy to a Self Model

```python theme={null}
result = epistemic_me.Philosophy.add_to_self_model(
    self_model_id="self_001",
    philosophy_id=philosophy["philosophy"]["id"]
)
```

* `create`: Creates a new philosophy. Returns the created philosophy and (optionally) extrapolated observation contexts.
* `update`: Updates an existing philosophy by ID.
* `add_to_self_model`: Associates a philosophy with a self model.

```python theme={null}
import epistemic_me
epistemic_me.api_key = "..."

philosophy = epistemic_me.Philosophy.create(
   self_model_id="self_001",
   description="...",
   extrapolate_contexts=False
)
```
