Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Track complex workflows with hierarchical tracing
const result = await lumina.trace('rag_pipeline', async (parentSpan) => { parentSpan.setAttribute('user_query', query); // Child span 1 const docs = await lumina.trace('retrieval', async () => { return await vectorDB.search(query); }); // Child span 2 const response = await lumina.traceLLM( () => llm.generate(buildPrompt(query, docs)), { name: 'synthesis', system: 'anthropic' } ); return response; });
rag_pipeline (2.5s, $0.05) ├── retrieval (1.8s, $0.01) │ ├── embedding (0.2s, $0.001) │ └── vector_search (1.6s, $0.009) └── synthesis (0.7s, $0.04)
await lumina.trace('operation', async (span) => { span.addEvent('step_1_started'); // Step 1 await processStep1(); span.addEvent('step_1_completed'); span.addEvent('step_2_started'); // Step 2 await processStep2(); span.addEvent('step_2_completed'); });