How atineiatte/deep-research-at-home works
Project type and purpose
• Type: A command-line AI research pipeline.
• Purpose:
– Accept a user query, generate starter searches.
– Build and iteratively refine a research outline based on user feedback.
– Perform iterative search cycles, synthesize results with an LLM (Gemma3-12b).
– Compose a multi-section research report with citations.
– Save final output to a text file.
File structure
Top-level entries:
– LICENSE
– README.md (project description, usage, architecture notes)
– gemma3-12b-prompt (prompt templates for LLM synthesis)
– granite30m mit 10k.gz (local model checkpoint or embeddings)
– pipe (core controller script)
– why (helper or config script)
Patterns & architectural hints:
– “pipe” and “why” suggest a modular pipeline.
– A standalone CLI tool with no explicit frontend/backend split.
– External dependencies implied: Python, LLM weights, search engine credentials.
Extract architecture insights from the README
– Iterative controller that tracks cycles, topic completion, repetition management.
– Modules for: starter-search generation, outline drafting & revision, synthesis, compression, per-section editing, final assembly.
– Integrations: SearXNG search API, archive.org fallback, Gemma3-12b for synthesis.
– Output: Text file in user’s home.
1. CLI Interface
– Reads user query & feedback.
2. Prompt Manager
– Loads templates (gemma3-12b-prompt).
3. Search Adapter
– Issues HTTP requests to SearXNG or archive.org.
– Applies delays, headers, retries.
4. Manager
– Drafts initial outline, applies user revisions.
5. Iterative Research Controller
– Tracks MAX_CYCLES, result windows, relevance penalties.
– Orchestrates search → synthesis loops.
6. Model Inference Engine
– Invokes Gemma3-12b (via local weights granite30m mit 10k.gz).
– Performs semantic compression & section synthesis.
7. Citation & Results Manager
– Collects, verifies, deduplicates sources.
8. Report Composer
– Assembles per-section outputs into final report (abstract, sections, conclusion).
9. Storage Module
– Writes final text file (~/research_export_…txt).
Relationships & data flow
• User Query → CLI → Prompt Manager
• Prompt → Search Adapter → Search Results
• Results → Outline Manager → User Feedback loop
• Revised Outline + Results → Iterative Controller → Model Engine
• Model Outputs → Citation Manager → Report Composer
• Final Report → Storage → User
Architectural patterns & design principles
– Pipeline Architecture: distinct stages connected in sequence.
– Modular Separation of Concerns: each component (search, outline, synthesis) is self-contained.
– Feedback Loop: user feedback integrated into outline manager, driving iteration.
– Data Flow Emphasis: clear flow from input through transformation to output.
– Configurable Parameters: MAX_CYCLES, token limits, compression settings.
Technologies & dependencies
– Language: Python (implied by .py or scripts).
– LLM: Gemma3-12b model weights (local).
– Search API: SearXNG, archive.org fallback.
– Prompt templates: plain-text files.
– Storage: local file system.