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

# Contextual Awareness Skill

> Query the organizational context graph for entities, relationships, and insights from connected integrations like Azure, Slack, and GitHub.

<CardGroup cols={2}>
  <Card title="Type" icon="tag">
    `contextual_awareness`
  </Card>

  <Card title="Database" icon="database">
    Neo4j Context Graph
  </Card>
</CardGroup>

**Purpose:** The Contextual Awareness skill enables agents to query your organization's context graph, discovering entities, relationships, and insights from all connected integrations.

***

## Common Use Cases

<CardGroup cols={2}>
  <Card icon="microsoft">
    **Discovering Azure resources**

    Find VMs, storage accounts, resource groups, and their relationships
  </Card>

  <Card icon="slack">
    **Understanding Slack relationships**

    Query channels, users, messages, and team structure
  </Card>

  <Card icon="sitemap">
    **Querying organizational structure**

    Explore teams, projects, and reporting relationships
  </Card>

  <Card icon="link">
    **Finding integration connections**

    Discover how systems and resources connect across your infrastructure
  </Card>
</CardGroup>

***

## What is the Context Graph?

The Context Graph is a living knowledge base that automatically captures relationships between all entities across your integrations:

<AccordionGroup>
  <Accordion title="Entities" icon="cube">
    **Nodes representing resources:**

    * Users, Teams, Projects
    * Cloud Resources (VMs, Databases, Networks)
    * Communication channels (Slack, Email)
    * Code repositories and commits
    * Incidents, tickets, alerts
  </Accordion>

  <Accordion title="Relationships" icon="link">
    **Edges connecting entities:**

    * `MANAGES`, `MEMBER_OF`, `OWNS`
    * `DEPENDS_ON`, `CONNECTED_TO`
    * `DEPLOYED_IN`, `RUNS_ON`
  </Accordion>

  <Accordion title="Properties" icon="tag">
    **Metadata on entities:**

    * Names, IDs, timestamps
    * Status, health, configuration
    * Costs, tags, labels
  </Accordion>
</AccordionGroup>

***

## Configuration

**Example Configuration:**

```json theme={null}
{
  "predefined_nodes": ["VirtualMachine", "Database", "Service"],
  "predefined_relationships": ["DEPENDS_ON", "CONNECTED_TO"],
  "allowed_integrations": ["Azure", "Slack"],
  "max_results": 100,
  "enable_caching": true
}
```

<AccordionGroup>
  <Accordion title="📋 Full Configuration Reference" icon="gear">
    | Parameter                  | Type    | Default | Description                    |
    | -------------------------- | ------- | ------- | ------------------------------ |
    | `predefined_nodes`         | array   | \[]     | Allowed entity types           |
    | `predefined_relationships` | array   | \[]     | Allowed relationship types     |
    | `allow_dynamic_search`     | boolean | false   | Allow freeform queries         |
    | `allowed_integrations`     | array   | \[]     | Limit to specific integrations |
    | `max_results`              | number  | 100     | Maximum results per query      |
    | `query_timeout`            | number  | 30      | Query timeout in seconds       |
    | `enable_caching`           | boolean | true    | Cache frequently accessed data |
    | `cache_ttl`                | number  | 300     | Cache time-to-live (seconds)   |
  </Accordion>
</AccordionGroup>

***

## Quick Start

```bash theme={null}
# Create skill
kubiya skill create --name "Infrastructure Explorer" --type contextual_awareness --enabled

# Associate with agent
kubiya skill associate agent <agent-id> <skill-id>
```

<Card title="View Complete Examples" icon="lightbulb" href="/core-concepts/skills/examples#context-graph">
  See full Cypher query examples, team structure queries, and incident analysis patterns
</Card>

***

## Query Examples

### Finding Resources

**Natural Language:**

```
"Show me all Azure VMs in the production environment"
```

**Cypher Query:**

```cypher theme={null}
MATCH (vm:VirtualMachine)-[:DEPLOYED_IN]->(env:Environment {name: 'production'})
WHERE vm.provider = 'Azure'
RETURN vm
```

### Exploring Relationships

**Natural Language:**

```
"What services depend on the user-database?"
```

**Cypher Query:**

```cypher theme={null}
MATCH (db:Database {name: 'user-database'})<-[:DEPENDS_ON]-(service:Service)
RETURN service
```

### Team Queries

**Natural Language:**

```
"Who are the members of the DevOps team?"
```

**Cypher Query:**

```cypher theme={null}
MATCH (user:User)-[:MEMBER_OF]->(team:Team {name: 'DevOps'})
RETURN user
```

***

## Security Best Practices

<AccordionGroup>
  <Accordion title="Restrict Node Types" icon="list-check">
    Limit `predefined_nodes` to only necessary entity types.

    ```json theme={null}
    "predefined_nodes": ["VirtualMachine", "Database"]  # Not all types
    ```
  </Accordion>

  <Accordion title="Limit Integrations" icon="filter">
    Use `allowed_integrations` to restrict which data sources can be queried.

    ```json theme={null}
    "allowed_integrations": ["Azure", "AWS"]  # Not Slack, GitHub, etc.
    ```
  </Accordion>

  <Accordion title="Set Query Limits" icon="gauge-simple">
    Configure `max_results` to prevent overly broad queries.

    ```json theme={null}
    "max_results": 100  # Prevent thousands of results
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  **Performance Tip:** Enable caching for frequently accessed data to reduce query latency.
</Tip>

***

## Troubleshooting & Related Skills

<AccordionGroup>
  <Accordion title="No Results Returned" icon="magnifying-glass-minus">
    **Solutions:**

    * Verify integration is connected and syncing data
    * Check entity type is in `predefined_nodes`
    * Review `allowed_integrations` includes data source
  </Accordion>

  <Accordion title="Query Timeout" icon="hourglass-end">
    **Solutions:**

    * Increase `query_timeout` value
    * Narrow query scope with filters
    * Enable caching to speed up repeated queries
  </Accordion>

  <Accordion title="Stale Data" icon="clock-rotate-left">
    **Solutions:**

    * Reduce `cache_ttl` value
    * Verify integration sync is running
    * Manually trigger sync if needed
  </Accordion>
</AccordionGroup>

### Related Skills

<CardGroup cols={2}>
  <Card title="Knowledge API" icon="brain" href="/core-concepts/skills/knowledge-api">
    Semantic search across organizational knowledge
  </Card>

  <Card title="Agent Communication" icon="users" href="/core-concepts/skills/agent-communication">
    Coordinate with specialized agents
  </Card>

  <Card title="Python Skill" icon="python" href="/core-concepts/skills/python">
    Process and analyze context graph data
  </Card>

  <Card title="View All Skills" icon="layer-group" href="/core-concepts/skills/built-in-skills">
    Return to built-in skills overview
  </Card>
</CardGroup>
