senselab.agentic_interface

Agentic Interface for SenseLab

The agentic_interface submodule provides a flexible, user-friendly bridge between natural language and code, enabling users to interact with SenseLab's AI agent for scientific coding, data analysis, and reproducible research—even without strong technical skills.

alt text


Motivation

The goal is to lower the entry barrier for non-programmers while keeping workflows transparent and reproducible for technical users. Many potential users of senseLab (e.g., clinicians, clinical researchers, students from non-technical domains) could benefit from audio data analysis but lack the Python expertise required today.

agentic_interface aims to:

  • Enable interactive exploration and analysis of audio datasets through natural-language interaction.
  • Generate reproducible code alongside the analysis, so that results can be shared, rerun, and extended.
  • Integrate seamlessly with existing SenseLab functionality without adding setup complexity.

In short: make audio analysis in senseLab as simple as asking questions, while still producing transparent, reproducible workflows.


We reviewed several existing tools that inspired this direction but also highlighted limitations that agentic_interface aims to overcome:

1. Jupyter AI

  • Reference: Jupyter AI
  • Strengths: Side-chat within Jupyter notebooks for natural-language queries.
  • Limitation: Does not yet support MCP server integration, which is key to exposing senseLab features as tools and enabling autonomous analysis.

2. PretzelAI

  • Reference: PretzelAI GitHub
  • Strengths: Chat interface, inline prompting, polished UI.
  • Limitation: Also lacks MCP server integration, making full tool-driven workflows harder.

3. Toolchain Integration via MCP

  • Workflow idea: Run jupyter-mcp-server to control a notebook, connect MCP clients like Claude Desktop, Cline, or LM Studio, and request analyses.
  • Tested: Works in principle.
  • Limitations:

    • Requires installing & launching multiple tools (high setup overhead for non-technical users).
    • Without a dedicated MCP server exposing SenseLab tools/docs, the LLM often gets confused about available functions.
    • Relies on external LLM usage credits, which can be restrictive.

4. Notebook Intelligence

  • Reference: notebook-intelligence
  • Strengths: Easy install, integrates chat and inline commands into JupyterLab, supports many LLMs (including local models like Ollama), and supports MCP servers (remote only for now).
  • Limitations:
    • Cannot enforce ReAct behaviors like consulting senseLab docs first, executing cells step-by-step, or test-driven coding (issue #63).
  • This is the one we currently use under the hood for our implementation.
1""".. include:: ./doc.md"""  # noqa: D415