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

# Memory Types

> Understanding different memory types in Hystersis

# Memory Types

Hystersis supports four types of memory for AI agents.

<img src="https://mintcdn.com/hystersis-510bad77/wB-1lV8z0CzteIqk/images/memory-flow.svg?fit=max&auto=format&n=wB-1lV8z0CzteIqk&q=85&s=ff5e4e0c1474274579e2c102b7dadd7d" alt="Memory Flow" style={{width: '100%', maxWidth: '700px', margin: '20px 0'}} width="700" height="320" data-path="images/memory-flow.svg" />

## Conversational Memory

Session-based message history for ongoing conversations.

```python theme={null}
session = client.create_session(agent_id="assistant")
client.add_message(session["id"], "user", "Hello!")
client.add_message(session["id"], "assistant", "Hi!")

messages = client.get_messages(session["id"])
```

## Semantic Memory

Vector-based memories with embedding search.

```python theme={null}
memory = client.create_memory(
    content="User is interested in machine learning",
    memory_type="user"
)

results = client.search("deep learning AI")
```

## Knowledge Graph

Entities and relationships for structured knowledge.

```python theme={null}
# Create entities
entity1 = client.create_entity("Machine Learning", "topic")
entity2 = client.create_entity("Deep Learning", "topic")

# Create relationship
client.create_relation(
    from_id=entity1["id"],
    to_id=entity2["id"],
    relation_type="RELATED_TO"
)
```

## Procedural Memory

Skills and procedures extracted from interactions.

```python theme={null}
# Extract skills
skills = client.extract_skills(
    content="When user asks about ML, explain neural networks"
)

# Suggest skills
suggestions = client.suggest_skills(trigger="Explain transformers")
```

## Choosing Memory Type

| Use Case             | Memory Type     |
| -------------------- | --------------- |
| Chat history         | Conversational  |
| Facts & preferences  | Semantic        |
| Structured knowledge | Knowledge Graph |
| Reusable patterns    | Procedural      |
