Add GraphScope-based agent filtering and refactor billing configs#595
Add GraphScope-based agent filtering and refactor billing configs#595
Conversation
- Introduced GraphScope class to define graph access restrictions for agents. - Implemented matches_graph_scope function to validate agent eligibility based on graph context. - Updated agent specifications to include graph_scope attribute. - Enhanced agent registry to serialize graph_scope for API responses. - Modified AgentOrchestrator to filter agents based on their graph_scope. - Added comprehensive tests for graph scope matching and orchestrator filtering.
- Consolidated document section and connection limits into a single max_documents parameter across billing plans. - Updated the get_tier_max_documents function to reflect the new structure. - Modified DocumentService and SearchService to utilize the new max_documents limit, removing deprecated tier checks. - Adjusted tests to align with the refactored limit checks, ensuring proper functionality.
- Removed max_queries_per_hour and infrastructure fields from billing plan definitions to streamline configuration. - Updated CreditService to retrieve backup limits from GraphTierConfig, ensuring consistent backup retention handling. - Adjusted offering retrieval logic to source infrastructure details and backup retention from a single configuration point. - Modified tests to reflect the removal of max_queries_per_hour, ensuring alignment with the new billing model structure.
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 2m 7s —— View job PR Review: Add GraphScope-based agent filtering and refactor billing configsTasks:
Overall AssessmentThis is a solid PR. The Bug:
|
- Updated SearchService to capture results from document uploads, improving error handling and response tracking. - Modified offering retrieval to include vCPU count in infrastructure descriptions, providing clearer resource specifications.
Summary
Introduces a
GraphScopemechanism for filtering agents based on graph context, while also refactoring billing plan configurations and document tier limits for improved clarity and maintainability.Key Changes
GraphScope Agent Filtering (Core Feature)
GraphScopeabstraction andmatches_graph_scopefunction to enable context-aware agent filteringbase.py)agent_registry.pyto incorporate graph scope awareness when resolving agentsBilling & Tier Refactoring
core.py, reducing complexity (~49 lines changed with net reduction)documents/service.pygraph/credit_service.pyto align with refactored billing structuresrouters/offering.py) with updated logic for plan presentationSearch Service Updates
Breaking Changes
offering.pyAPI model — any consumers relying on this field will need to be updatedcore.py— downstream services or tools that directly parse these configurations may require updatesdocuments/service.pyhave been updated, which may affect callersTesting
tests/operations/agents/test_graph_scope.py— 260 lines) covering scope matching, agent filtering, and edge casesInfrastructure Considerations
🤖 Generated with Claude Code
Branch Info:
feature/graph-scoped-agentsmainCo-Authored-By: Claude noreply@anthropic.com