Skip to content

Repository files navigation

Tiny Researcher 🧠

Tiny Researcher is a lightweight, multi-agent AI research tool designed to autonomously execute deep research tasks, scrape web pages, and compile beautifully formatted markdown reports.

Note: As a tiny researcher, this system relies on intelligent slicing and context truncation to stay within standard LLM context limits (e.g., 32k/40k tokens). It is highly effective for focused tasks but cannot ingest massive, unlimited contexts (like entire book-length repositories in a single prompt).

🚀 Capabilities

  • Autonomous Agent Spawning: Dynamically spawns specialized AI worker agents based on the complexity and scope of the research prompt.
  • Adaptive Planning: A master planner agent breaks down your initial prompt into distinct sub-tasks and writes custom system prompts for each worker.
  • Web Search & Scraping: Worker agents are equipped with tools to search the web and scrape markdown content from URLs to gather facts.
  • Adaptive Report Generation:
    • For complex topics, it generates a highly structured academic report (Abstract, Findings, Conclusion, etc.).
    • For simple queries, it provides clean, direct answers.
    • All outputs include proper citations and references.
  • Safe Context Management: Intelligently truncates web scrapes and combined reports using tokenx to prevent LLM context-window overflow.
  • Error Handling & Short-circuiting: If any worker agent encounters an API error, the research chain safely halts, logs the exact error to the UI, and prevents further token waste.

🛠️ Tech Stack & Implementation

  • Backend: Hono server running on Bun for ultra-fast performance.
  • AI Framework: LangChain for agent orchestration and tool binding.
  • Models: Configured to use Mistral AI (codestral-2501 and mistral-large-latest) for planning, reasoning, and reporting.
  • State Management: Redis is used for extreme simplicity and speed. It tracks active jobs, stores intermediate agent logs, and maintains temporary agent memory.

🖥️ Simple Web UI

Tiny Researcher comes with a clean, responsive, Bootstrap-based UI out of the box:

  • Dashboard: View all past and currently running research jobs.
  • Live Progress: Watch agents spawn in real-time and toggle their accordion cards to view their specific system prompts and terminal-like execution logs.
  • Markdown Viewer: Read the final output rendered cleanly with GitHub-flavored markdown CSS.
  • PDF Export: Download the finished report as a beautifully formatted PDF with a single click.

⚙️ Setup & Installation

  1. Install Dependencies:

    bun install
  2. Environment Variables: Create a .env file in the root directory:

    MISTRAL_API_KEY=your_mistral_api_key
    CRAWL_API_URL=http://localhost:11235
    SEARCH_API_URL=http://localhost:11222
  3. Start Redis: Ensure you have a local Redis instance running on port 6379. (You can easily start one using Docker: docker run -p 6379:6379 -d redis).

  4. Run the App:

    npm run dev
    # or
    bun run dev
  5. Access the UI: Open your browser and navigate to http://localhost:3000.

🧹 Maintenance

The UI includes a "Clear Redis" option in the settings dropdown to instantly wipe all past jobs, logs, and agent memories if you want to start fresh.

About

Tiny Researcher is a lightweight, multi-agent AI research tool designed to autonomously execute deep research tasks, scrape web pages, and compile beautifully formatted markdown reports.

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages