Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-omnicoreagent.omnirexfloralabs.com/llms.txt

Use this file to discover all available pages before exploring further.

Production

Deploy OmniCoreAgent with confidence. Runtime usage metrics and guardrails.

Examples

FileWhat You’ll Learn
metrics_observability.pyTrack tokens, requests, response times, and usage for cost estimation
guardrails.pyProtect agents from prompt injection attacks

📊 Metrics & Observability

Track everything your agent does:
from omnicoreagent import OmniCoreAgent

agent = OmniCoreAgent(
    name="monitored_agent",
    system_instruction="You are a helpful assistant.",
    model_config={"provider": "openai", "model": "gpt-4o"},
    agent_config={
        "request_limit": 100,
        "total_tokens_limit": 50000,
    },
)

# After running queries...
metrics = await agent.get_metrics()
print(f"Total requests: {metrics['total_requests']}")
print(f"Total tokens: {metrics['total_tokens']}")
print(f"Request tokens: {metrics['total_request_tokens']}")
print(f"Response tokens: {metrics['total_response_tokens']}")
Available Metrics:
  • total_requests — Number of agent.run() calls
  • total_tokens — Total tokens used (input + output)
  • total_request_tokens — Tokens sent to LLM
  • total_response_tokens — Tokens received from LLM

🛡️ Guardrails

Protect against prompt injection attacks:
agent = OmniCoreAgent(
    name="protected_agent",
    system_instruction="You are a customer service agent.",
    model_config={"provider": "openai", "model": "gpt-4o"},
    agent_config={
        "guardrail_config": {
            "strict_mode": True,  # Block suspicious inputs
        },
    },
)
Guardrails Detect:
  • Prompt injection attempts
  • Jailbreak attempts
  • System prompt extraction attempts
  • Role manipulation attacks

🔧 Usage Limits

Set limits to prevent runaway request or token usage:
agent_config={
    "request_limit": 100,        # Max requests per session
    "total_tokens_limit": 50000, # Max tokens before stopping
    "max_steps": 10,             # Max reasoning loops
}

Previous: Background Agents — Scheduled autonomous tasks