Create Image on how you use library db and how does agent adapts and iterate on information it finds

Generating Image
AI Agent Library DB Workflow
Here's a breakdown of what the diagram illustrates:
Query Phase The agent starts with the user's question and formulates an initial search — using FTS5 full-text search against headings and paragraphs across all indexed medical textbooks.
Database Interaction The Library DB returns matched blocks: section headings, paragraph snippets, book titles, and file paths. The agent reads these results in chunks (100 lines at a time) using pagination.
Adaptation & Iteration Loop
  • If results are insufficient (too vague, off-topic, or sparse), the agent refines its query — broadening terms, trying synonyms, switching from heading search to paragraph search, or targeting a different speciality.
  • If results are sufficient, it synthesizes them into a coherent answer with citations.
Key Adaptation Strategies
  • Switch between headings_fts (topic-level) and paragraphs_fts (deep content) searches
  • Use Boolean operators (AND, OR) and phrase search ("exact phrase")
  • Cross-reference multiple textbooks across specialities
  • Follow file paths to read full blocks when snippets aren't enough
This is a shared conversation. Sign in to Orris to start your own chat.