Skip to main content

Universal AI agent observability — trace every LLM provider, framework, and vector DB

Project description

Nyraxis Python SDK

Universal AI agent observability — trace every LLM provider, framework, and vector DB automatically.

Installation

pip install nyraxis-sdk

Quick Start (Recommended)

import nyraxis_sdk

nyraxis_sdk.init(
    api_key="nyx_your_api_key",
    base_url="https://your-nyraxis-backend.com",
    agent_name="my-agent",
)

# That's it. All LLM calls are now auto-traced.
# No code changes needed — works with any provider or framework below.

# Before process exit:
nyraxis_sdk.shutdown()

Trace Grouping

from nyraxis_sdk import workflow, task

@workflow(name="research-agent")
def run_agent(query):
    summary = summarize(query)
    return summary

@task(name="summarize")
def summarize(text):
    # LLM calls inside here are grouped under this task
    return openai.chat.completions.create(...)

Auto-Instrumented

LLM Providers (20+)

OpenAI, Anthropic, Google (Gemini/PaLM/VertexAI), Cohere, Mistral, AWS Bedrock, Azure OpenAI, Ollama, Together AI, Groq, Replicate, HuggingFace, AI21, Aleph Alpha, DeepSeek, Fireworks, Perplexity, WatsonX, SageMaker

Frameworks (10+)

LangChain, LlamaIndex, CrewAI, Haystack, AutoGen, Semantic Kernel, DSPy, Marvin, Instructor, Guidance, Letta

Vector Databases (9+)

Pinecone, Chroma, Weaviate, Qdrant, Milvus, PGVector, Redis, LanceDB, Marqo

Span Types Captured

Type Description
llm LLM chat/completion calls
embedding Embedding generation
tool Tool/function calls
retrieval Vector DB queries
reranker Reranking operations
agent Agent orchestration
workflow Workflow grouping
task Task execution
guardrail Guardrail checks
memory Memory read/write
generic Other operations

Legacy Mode (Removed)

Framework-specific handlers (framework="langchain" etc.) have been removed in v0.4.0. Auto mode covers everything they did and more. Migration:

# Before (v0.3):
handler = nyraxis_sdk.init(api_key="nyx_...", framework="langchain")
llm = ChatOpenAI(callbacks=[handler])

# After (v0.4):
nyraxis_sdk.init(api_key="nyx_...")
llm = ChatOpenAI()  # auto-traced, no callbacks needed

Direct API Client

from nyraxis_sdk import NyraxisClient

async with NyraxisClient(api_key="nyx_your_api_key") as client:
    await client.ingest_trace(
        trace_id="trace-123",
        spans=[...],
        resource_attributes={"service.name": "my-agent"},
    )

Generic OTLP Endpoint

Any OpenTelemetry-instrumented app can send traces directly:

POST /api/v1/ingest/otel/v1/traces
Header: X-API-Key: nyx_...
Content-Type: application/json
Body: Standard OTLP ExportTraceServiceRequest (JSON or Protobuf)

This means frameworks with native OTEL support (AutoGen, Semantic Kernel, DSPy, etc.) can send traces to Nyraxis without using this SDK at all.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nyraxis_sdk-0.4.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nyraxis_sdk-0.4.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file nyraxis_sdk-0.4.1.tar.gz.

File metadata

  • Download URL: nyraxis_sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nyraxis_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8c7734196bd2523e299014d4db389239eca57fd6b2c49f2a3efcd0eea50bc90d
MD5 da5c07f63738213dd4663858f87c795c
BLAKE2b-256 2bcf940a18706b2dcb42eb8f429ab0eedc6d7f68c0071d8fd6da2040a3adc88b

See more details on using hashes here.

File details

Details for the file nyraxis_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: nyraxis_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nyraxis_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74af7da399045b204b8e5e001a92d0250945272b5bea2bac0cd2024dd7e8cf48
MD5 c5f86aa9f43a3fbc7e56bbabd8f19c17
BLAKE2b-256 537495a4c495aaa71a7888fb7ef05fd2588f4f4700ba844c715871f9f2481687

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page