Agentic AI for autonomous scientific workflows in gravitational lensing research
DLens is a multi-agent framework for autonomously orchestrating scientific workflows in gravitational lensing research. It provides agentic capabilities for reasoning, decision-making, and workflow automation, enabling LLM-powered agents to coordinate complex multi-step processes with minimal human supervision.
DLens is built as an abstraction layer over Pydantic AI, leveraging its type-safe agent framework to create robust, composable agentic workflows. This foundation provides structured data validation, seamless integration with language models, and a clean API for building complex multi-agent systems.
DLens is designed to operate primarily with locally hosted or on-premise language models, avoiding dependencies on third-party model services. System prompts are constrained, focused, and information-dense, minimizing context usage to reduce both computational overhead and the risk of hallucination.
DLens follows a divide-and-conquer approach to agent design. Complex tasks are decomposed into smaller, well-scoped subproblems, each handled by a dedicated agent or a single LLM call. This improves reliability, reduces cognitive load on individual models, and enables more predictable and debuggable workflows.
For complex multi-tool-use agents that require larger LLMs with API access, DLens also supports a ReAct (Reasoning + Acting) framework, enabling iterative reasoning-action loops where agents can plan, execute tools, observe results, and adapt their strategy across multiple steps.
This guide walks you through setting up the dlens library.
uv is a fast Python package and environment manager used by this project.
curl -LsSf https://astral.sh/uv/install.sh | shDo yourself a favor and switch to Linux or macOS.
(But if you insist: powershell -c "irm https://astral.sh/uv/install.ps1 | iex")
Restart your terminal, then verify:
uv --versiongit clone https://github.com/pranath-reddy/DeepLense-AI-Scientist.git
cd DeepLense-AI-Scientistuv venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windowsuv pip install -e .uv run python scripts/sanity_check.pyOr run the test suite:
uv run pytest