Skip to content

Add context composition endpoint for LLM-ready entity summaries #230

@ravisuhag

Description

@ravisuhag

Context

AI agents have limited context windows and need pre-composed, information-dense summaries rather than raw API responses. Compass should offer a context composition endpoint that aggregates everything known about an entity into a single LLM-ready document.

Current State

GetEntityContext RPC and the MCP get_context tool exist and return entity + edges + related entities. This issue tracks the remaining gaps to reach the full vision.

Scope

Enhance the context composition to return a composed document combining:

  • Schema with column descriptions and types (from entity properties)
  • Immediate upstream and downstream lineage (from edges)
  • Current owners and responsible teams (from owned_by edges)
  • Last schema change and recent modifications (from temporal entity history via valid_from/valid_to)
  • Freshness and quality signals (from entity properties written by ingesters)
  • Related entities and documentation links (from edges)

Design Considerations

  • Output format should be structured markdown optimized for LLM context windows
  • Support configurable depth and detail levels:
    • summary — for broad exploration
    • detailed — for SQL generation (full column-level detail)
    • diagnostic — for issue investigation (lineage + change history)
  • Should be available through both REST/gRPC and the MCP server

Why

Raw JSON payloads waste context window tokens and require the AI agent to parse and reason over structure. A composed context document gives the agent exactly what it needs in a format it can reason over efficiently.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions