# Metacognition

Part of what differentiates Levia from a usual agent runtime is it's ability to embed **metacognitive abilities** in an agent, or the ability to "think about thinking". With Levia's engine, agents can:&#x20;

* Dynamically learn and orchestrate new tools
* Automatically run test suites during tool integration and user queries
* Leverage its memory system to optimize tool usage and workflows

This form of metacognition allows Levia to drive optimizations across multiple dimensions, including:

* **Intent interpretation:** Enhancing accuracy in understanding user queries
* **Tool orchestration:**
  * Updating selection criteria to choose the most appropriate toolset
  * Refining the sequence and combination of tool executions
* **Memory management:**
  * Pruning inactive memory branches
  * Indexing past interactions for personalized experiences
* **Tool integration:**
  * Running automated test suites (See "Integrating a New Tool" for details)

#### Metacognitive States

&#x20;A core part of Levia's metacognition is enabled by the use of "**cognitive states**". Cognitive states allow the system to switch between different modes of reasoning and execution, analogous to how humans adapt their focus to tackle the task at hand. Levia operates in three primary states:

1. **Conversational State:**
   * Handles simple dialogue processing
   * Engages in natural language interactions
2. **Operational Command State:**
   * Executes structured tasks and complex operations
   * Manages multi-step workflows
3. **Multi-Tool State:**
   * Coordinates multiple tools simultaneously
   * Monitors data flow and state persistence
   * Recovers from state disruptions

**Transparency** is crucial to Levia's mission. The engine outputs cognitive streams (logs) and maintains detailed reasoning traces, allowing developers to fine-tune workflows and responses based on captured insights.&#x20;

Information about how Levia achieves this is detailed in our Core Architecture.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://leviaprotocol.gitbook.io/leviaprotocol/core-concepts/metacognition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
