Building Outage Memory for AI Agents: Better Stack Connector for Cognee
High availability is the bedrock of any software system. Monitoring tools like Better Stack (Better 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.
Why Connect Better Stack to Cognee?
Autonomous AI coding agents, DevOps assistants, and support bots frequently need infrastructure context:
- "Which API endpoints failed health probes during yesterday's release?"
- "What was the root cause of the last 502 Bad Gateway alert?"
- "How long did it take between monitor alert triggering and engineer acknowledgment?"
With the better_stack connector for Cognee, this telemetry becomes part of the AI's long-term memory.
How It Works
The connector lives in packages/connector/better_stack/ within cognee-community.
1. Ingestion Pipeline
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.
2. Narrative Prose Extraction
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
3. Entity Graph Linking
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.
Getting Started
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.
Top comments (0)