Skip to content

shadril238/deep-research-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Research Assistant

An end‑to‑end, multi‑agent system that turns a user topic into a cited report. A planner proposes subtopics, a searcher gathers sources, a verifier filters and ranks them for credibility and relevance, a writer produces a structured Markdown article with inline [n] citations and a references list, and an evaluator (with optional optimizer) improves quality. All artifacts—sources, logs, and final reports—are saved under data/, and you can run it from the CLI or the Gradio UI.

Workflow

High-level process flow:

User Topic/Question
        |
        v
   Planner (subtopics)
        |
        v
   Searcher (web sources)
        |
        v
   Verifier (filter/rank)
        |
        v
   Writer (draft with [n] citations)
        |
        v
   Evaluator (score) -- score < 7 --> Optimizer (refine)
        |
        v
 Persist: data/sources + data/reports + data/logs

Details:

  • Input is a single topic/question from CLI or UI.
  • Planner suggests angles to guide search and writing.
  • Searcher gathers candidate sources; Verifier scores and prunes them.
  • Writer produces a Markdown article with inline [n] citations and a references list.
  • Evaluator rates quality; Optimizer refines only if the score is below a threshold.
  • All outputs and decisions are saved under data/ for auditability.

Setup

  • Python 3.10+
  • Install dependencies:
    • pip install -r requirements.txt
  • Environment variables (use a .env file):
    • GEMINI_API_KEY=...
    • GEMINI_MODEL_ID=gemini-1.5-pro-latest (or another Gemini model)
    • TAVILY_API_KEY=... (for web search)

CLI Usage

Run a full pipeline on a topic and save outputs under data/:

python main.py "What is the impact of AI on education?"

Outputs:

  • data/reports/<slug>-<timestamp>.md — final Markdown article with references
  • data/logs/<slug>-<timestamp>.log — agent steps and notes
  • data/sources/<slug>-<timestamp>.json — kept/dropped sources and planning

Example

Example topic: “What is the impact of AI on education?”

Run:

python main.py "What is the impact of AI on education?"

Sample agent log (truncated):

Planning research...
Subtopics Identified:
- Historical adoption trends
- Personalized learning and tutoring
- Teacher workload and tools
- Equity, access, and bias
- Policy, privacy, and safety

Searching for documents...
Found 6 candidates.
Verifying and ranking sources...
Keeping 4, dropping 2.
Generating draft report...
Draft generated.
Evaluating report quality...
Score: 8/10
Score sufficient. Skipping optimization.

Sample report (excerpt):

# The Impact of AI on Education

AI is reshaping how students learn and how teachers teach. At its best, it enables personalized tutoring, richer feedback, and time savings for educators [1][2]. Yet risks include bias, over‑reliance, and privacy concerns [3][4].

## Where AI Helps Most
- Targeted feedback and differentiation for mixed‑ability classrooms [1]
- Automating routine grading and lesson prep [2]

## Risks and Open Questions
- Data privacy and security practices vary widely [3]
- Equity: access to devices and connectivity remains uneven [4]

---

References

[1] Source Title A — https://example.com/a
[2] Source Title B — https://example.com/b
[3] Source Title C — https://example.com/c
[4] Source Title D — https://example.com/d

Saved files:

  • data/reports/what-is-the-impact-of-ai-on-education-YYYYMMDDTHHMMSSZ.md
  • data/logs/what-is-the-impact-of-ai-on-education-YYYYMMDDTHHMMSSZ.log
  • data/sources/what-is-the-impact-of-ai-on-education-YYYYMMDDTHHMMSSZ.json

UI (optional)

Launch the Gradio interface:

python ui/interface.py

Agents

  • Planner: break down the research query into subtopics
  • Searcher: retrieve candidate sources via Tavily
  • Verifier: score credibility/relevance, deduplicate, select best sources
  • Writer: synthesize a structured, cited Markdown article
  • Evaluator: rate draft quality; Optimizer: refine if needed

Notes

  • This project uses the Gemini API and Tavily search; ensure keys are valid.
  • Citations are inline [n] with a references list appended for easy access.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages