Skip to content

feat: add llama-index-callbacks-hdp and hdp-llamaindex packages#21

Closed
asiridalugoda wants to merge 3 commits intomainfrom
claude/youthful-haslett
Closed

feat: add llama-index-callbacks-hdp and hdp-llamaindex packages#21
asiridalugoda wants to merge 3 commits intomainfrom
claude/youthful-haslett

Conversation

@asiridalugoda
Copy link
Copy Markdown
Contributor

Summary

  • Adds llama-index-callbacks-hdp — three-layer HDP integration for LlamaIndex following the LlamaHub implicit namespace convention (from llama_index.callbacks.hdp import ...)
  • Adds hdp-llamaindex — thin metapackage re-exporting for users who discover HDP first (pip install hdp-llamaindex)
  • Fills the last major gap in HDP's Python framework coverage (MCP, CrewAI, AutoGen, Grok/xAI, LangChain already supported)

Integration layers

Layer 1 — Modern instrumentation dispatcher (HdpInstrumentationHandler): hooks QueryStartEvent, AgentToolCallEvent, LLMChatStartEvent, QueryEndEvent via the root dispatcher. Recommended for LlamaIndex ≥0.10.20.

Layer 2 — Legacy CallbackManager (HdpCallbackHandler): hooks start_trace, end_trace, on_event_start/end. Drop-in via Settings.callback_manager.

Layer 3 — Node postprocessor (HdpNodePostprocessor): records retrieval as a signed hop and optionally enforces data_classification scope against node metadata. Used inline in RAG pipelines.

All three layers share a ContextVar for token state — asyncio-safe, no cross-request leakage.

Test Plan

  • 43 tests passing across session isolation, chain verification, callback handler, and postprocessor
  • Package installs and all imports verified against Python 3.13 + llama-index-core 0.12.x
  • verify_chain() confirms tamper-evident chain integrity end-to-end
  • Strict and observe modes verified for scope violations and data classification enforcement

Full integration strategy covering instrumentation handler, legacy
callback handler, node postprocessor, dual-publish packaging, and
three-phase LlamaHub/docs PR/blog campaign.
Three-layer integration providing cryptographic authorization provenance
for LlamaIndex agents and RAG pipelines:

- Layer 1: HdpInstrumentationHandler — modern dispatcher integration
  (LlamaIndex >=0.10.20), hooks QueryStartEvent, AgentToolCallEvent,
  LLMChatStartEvent, QueryEndEvent via root dispatcher
- Layer 2: HdpCallbackHandler — legacy CallbackManager integration,
  hooks start_trace, end_trace, on_event_start/end for all FUNCTION_CALL
  and LLM events
- Layer 3: HdpNodePostprocessor — inline retrieval hop recording and
  data classification enforcement in the RAG pipeline

Shared ContextVar session state isolates tokens across concurrent async
tasks. All crypto primitives bundled inline (Ed25519 + RFC 8785 JCS),
consistent with all other HDP Python packages.

hdp-llamaindex is a thin metapackage re-exporting from the llama_index
namespace for users who discover HDP first.

43 tests passing across session isolation, chain verification, callback
handler, and postprocessor.
@asiridalugoda asiridalugoda deleted the claude/youthful-haslett branch April 8, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant