arifos-langfuse
SolidInstrument arifOS constitutional AI kernel with Langfuse LLM tracing. Use when (1) adding Langfuse tracing to arifOS tool calls, (2) wiring arifOS telemetry to Langfuse cloud or self-hosted, (3) querying arifOS trace data from Langfuse, (4) migrating arifOS mind_reason/heart_critique calls to Langfuse spans. DITEMPA BUKAN DIBERI — Forged, Not Given.
AI & Automation 49 stars
8 forks Updated 2 weeks ago AGPL-3.0
Install
Quality Score: 80/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# arifOS-Langfuse Skill
Instrument arifOS constitutional AI operations with Langfuse LLM tracing.
## Architecture
```
arifOS Kernel (Python)
└── arifosmcp/runtime/telemetry.py ← Telemetry wrapper
├── Prometheus metrics (counters, histograms)
└── Langfuse v3 span tracing ← HERE
├── context manager: with lf.start_as_current_observation() as span
├── span.update(input={...}, output={...})
└── lf.flush()
```
arifOS uses Langfuse Python SDK v3 with **context manager pattern** — spans auto-close on exit.
## Credentials
arifOS → Langfuse (cloud Japan):
```bash
export LANGFUSE_PUBLIC_KEY=pk-lf-YOUR_PUBLIC_KEY
export LANGFUSE_SECRET_KEY=sk-lf-YOUR_SECRET_KEY
export LANGFUSE_HOST=https://jp.cloud.langfuse.com
```
arifOS → Langfuse (self-hosted on VPS):
```bash
export LANGFUSE_HOST=http://langfuse-web:3000
# same keys
```
## Key Patterns
### Correct span creation (v3 context manager)
```python
from langfuse import Langfuse
lf = Langfuse(
public_key=os.getenv("LANGFUSE_PUBLIC_KEY"),
secret_key=os.getenv("LANGFUSE_SECRET_KEY"),
host=os.getenv("LANGFUSE_HOST", "https://jp.cloud.langfuse.com")
)
# WRONG — detached span, no active context
lf.start_as_current_observation(as_type="span", name="arifOS::tool-name")
lf.update_current_span(...)
# CORRECT — context manager, span auto-closes
with lf.start_as_current_observation(as_type="span", name="arifOS::tool-name", metadata={...}) as span:
span.update(in...
Details
- Author
- ariffazil
- Repository
- ariffazil/arifOS
- Created
- 9 months ago
- Last Updated
- 2 weeks ago
- Language
- Python
- License
- AGPL-3.0
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
langfuse-observability
LLM observability with Langfuse — tracing, evaluation, prompt versioning, cost tracking, and LLM-as-judge scoring
5 Updated 1 weeks ago
ArieGoldkin AI & Automation Solid
ai-observability-langfuse
LLM observability with Langfuse — OpenTelemetry-based tracing, evaluations, prompt management, datasets, and production best practices
21 Updated 1 weeks ago
agents-inc