# Building Outage Memory for AI Agents: Better Stack Connector for Cognee

> Source: <https://dev.to/basant_nema31/building-outage-memory-for-ai-agents-better-stack-connector-for-cognee-2f3b>
> Published: 2026-10-23 15:04:49+00:00

High availability is the bedrock of any software system. Monitoring tools like [Better Stack (Better Uptime)](https://betterstack.com/uptime) track endpoint heartbeats, SSL validity, API responsiveness, and on-call paging around the clock.

Yet, when incidents happen, the knowledge is often trapped in incident dashboards and alert history logs.

By integrating Better Stack with **Cognee**, we can transform infrastructure telemetry and outage reports into queryable knowledge graphs for AI engineering agents.

Autonomous AI coding agents, DevOps assistants, and support bots frequently need infrastructure context:

With the `better_stack` connector for Cognee, this telemetry becomes part of the AI's long-term memory.

The connector lives in `packages/connector/better_stack/` within `cognee-community`.

The connector calls Better Stack's REST API v2 (`/incidents` and `/incidents/{id}/timeline`), handling pagination and exponential retry backoff on HTTP 429/5xx responses.

Each outage report is structured into markdown format for Cognee's entity extraction:

```
# Better Stack Incident: API Gateway 502 Bad Gateway

- **Status:** resolved
- **Started At:** 2026-10-12T08:00:00Z
- **Resolved At:** 2026-10-12T08:14:00Z

## Root Cause & Description
Upstream backend timed out during deployment rollback.

## Chronological Timeline
- **[2026-10-12T08:00:00Z]** Triggered - Monitor check failed 3 consecutive times
- **[2026-10-12T08:02:00Z]** Acknowledged - Engineer on-call acknowledged via Slack
- **[2026-10-12T08:14:00Z]** Resolved - Rollback completed and healthy probes returned HTTP 200
```

Because the source specifies `cognee_document_source = "better_stack"`, Cognee treats each outage report as a first-class knowledge document. The graph links endpoints, error codes, and resolution steps so agents can recall operational history instantly.

``` python
import asyncio
import cognee
from cognee_community_connector_better_stack import better_stack_source

async def main():
    source = better_stack_source()
    await cognee.add(source)
    await cognee.cognify()

    results = await cognee.search("Which services experienced downtime last week?")
    for res in results:
        print(res)

if __name__ == "__main__":
    asyncio.run(main())
```

Operational observability meets AI memoryâ€”ensuring your agents never forget past system lessons.
