Observability with Keywords AI
Keywords AI provides observability and tracing for LLM-powered and agentic applications. In Cognee, it captures spans for tasks and workflows via the same @observe
decorator used across providers.
Keywords AI inside Cognee
Cognee exposes a single abstraction for observability: get_observe()
returning the @observe
decorator. The Keywords AI integration is provided via the cognee-community
extension hub as cognee-community-observability-keywordsai
.
- About
cognee-community
: This is Cognee’s extension hub. Adapters for third‑party databases, pipelines, and community-contributed tasks live here, evolving independently from core. Installs stay slim (only what you need), and a predictable layout underpackages/*
keeps providers consistent. - Drop-in: Importing the package patches Cognee’s
get_observe()
to return a Keywords AI–backed decorator whenMONITORING_TOOL=keywordsai
. - Decorator mapping:
@observe
and@observe(workflow=True)
map to Keywords AI’stask()
andworkflow()
decorators fromkeywordsai-tracing
.
Installation and Configuration
pip install cognee-community-observability-keywordsai
# Required
export MONITORING_TOOL=keywordsai
export KEYWORDSAI_API_KEY=<your_KeywordsAI_key>
# If your pipeline elsewhere calls LLMs (optional)
export LLM_API_KEY=<your_OpenAI_key>
Minimal Example
# 1) Import to patch Cognee
import cognee_community_observability_keywordsai # noqa: F401
# 2) Use Cognee's abstraction
from cognee.modules.observability.get_observe import get_observe
observe = get_observe() # returns Keywords AI decorator when MONITORING_TOOL=keywordsai
# 3) Decorate a task
@observe
def ingest_files(data: list[dict]):
...
# 4) Decorate a workflow
@observe(workflow=True)
async def main():
...
Behind the scenes, Cognee’s community adapter:
- Patches
get_observe()
so it returns a Keywords AI–aware decorator when configured. - Initializes telemetry via
KeywordsAITelemetry()
once on import. - Wraps tasks with
task()
and workflows withworkflow()
fromkeywordsai-tracing
.
Quick Start
-
Install the integration:
pip install cognee-community-observability-keywordsai
-
Configure your environment:
export MONITORING_TOOL=keywordsai export KEYWORDSAI_API_KEY=<your_KeywordsAI_key> export LLM_API_KEY=<your_OpenAI_key>
-
Import the package early (so
get_observe()
is patched), decorate your tasks/workflows, and run your pipeline. -
Open your Keywords AI dashboard to inspect spans across tasks and workflows.
Useful Links
- Get a Keywords AI API key: Keywords AI Platform
- Community package: cognee-community/packages/observability/keywordsai
Join the conversation on Discord and let us know how the Keywords AI integration works for you!