Skip to content

Add deep search agents with context management#123

Draft
muthukumaranR wants to merge 3 commits intodevelopfrom
enhance/deep-search-agents
Draft

Add deep search agents with context management#123
muthukumaranR wants to merge 3 commits intodevelopfrom
enhance/deep-search-agents

Conversation

@muthukumaranR
Copy link
Collaborator

Summary

Add content condensation and context management capabilities to deep search agents for handling large search results.

Changes

  • Content Condensation Component: LLM-based component that extracts only information relevant to research questions
  • Research Synthesis Updates: Integrated content condensation with token budget allocation
  • Deep Search Agent Updates: Added condensation before synthesis to prevent context overflow
  • Token Management: Accurate token counting with tiktoken and intelligent allocation per result
  • Debug Logging: Track token usage and compression ratios

Usage

# Content condensation component
from akd.agents.search.components.content_condensation import ContentCondensationComponent

condensation = ContentCondensationComponent()
result = await condensation.arun(ContentCondensationInputSchema(
    research_question="What are the effects of climate change?",
    search_results=search_results,
    max_tokens=4000
))

# Deep search with automatic context management
from akd.agents.search.deep_search import DeepSearchAgent

agent = DeepSearchAgent(debug=True)
result = await agent.arun(DeepSearchInputSchema(
    research_question="Climate change impacts on agriculture",
    max_search_results=20
))

Testing

  • Integration tests for content condensation workflow
  • Token counting and compression ratio validation
  • Deep search agent context management tests

- LLM-based component that condenses SearchResultItem content
- Extracts only information relevant to research questions
- Honors token limits with intelligent allocation per result
- Uses tiktoken for accurate token counting
- Configurable model and temperature settings
github-actions bot added a commit that referenced this pull request Aug 19, 2025
github-actions bot added a commit that referenced this pull request Aug 19, 2025
github-actions bot added a commit that referenced this pull request Aug 19, 2025
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