Skip to main content

AI-powered research assistant using LangGraph

Project description

๐Ÿ”ฌ AI Research Assistant

Python Version Code style: black Type Checker: mypy License: MIT PRs Welcome Status: Active Development

An intelligent, LLM-powered research assistant built with LangGraph that conducts comprehensive research through multi-agent collaboration, structured interviews, and automated report generation.


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

The AI Research Assistant is a sophisticated research automation system that leverages large language models (LLMs) and multi-agent orchestration to conduct in-depth research on any topic. It simulates a team of expert analysts who collaboratively investigate a subject, conduct interviews, and produce comprehensive research reports.

What It Does

  1. Generates Expert Analysts: Creates a diverse team of AI analysts with specific expertise relevant to your research topic
  2. Conducts Structured Interviews: Each analyst performs deep-dive interviews using web search and knowledge retrieval
  3. Synthesizes Information: Aggregates insights from multiple perspectives into a cohesive narrative
  4. Produces Professional Reports: Generates well-structured, citation-rich research documents

Use Cases

  • ๐Ÿ” Academic Research: Literature reviews, topic exploration, comparative analysis
  • ๐Ÿ’ผ Market Research: Industry analysis, competitive intelligence, trend identification
  • ๐Ÿ“Š Policy Analysis: Multi-stakeholder perspectives, impact assessment
  • ๐Ÿš€ Technology Assessment: Emerging technologies, feasibility studies
  • ๐Ÿ“š Knowledge Synthesis: Cross-domain insights, expert opinions compilation

โœจ Key Features

๐Ÿค– Multi-Agent Research System

  • Dynamic Analyst Generation: Creates specialized analysts tailored to your research question
  • Parallel Interview Execution: Conducts multiple research streams simultaneously for efficiency
  • Human-in-the-Loop: Review and provide feedback on generated analysts before research begins
  • Flexible Configuration: Adjust analyst count, interview depth, and research parameters

๐Ÿ” Advanced Search Integration

  • Web Search: Tavily API integration for current information
  • Wikipedia Integration: Encyclopedic knowledge base access
  • Configurable Search Strategies: From minimal to comprehensive search modes
  • Result Caching: Avoid redundant API calls and reduce costs

๐Ÿ“ Intelligent Report Generation

  • Structured Output: Introduction, methodology, findings, analysis, and conclusions
  • Citation Management: Automatic source tracking and reference formatting
  • Markdown Export: Professional, readable report format
  • Section-wise Generation: Parallel generation of report sections for speed

๐Ÿ—๏ธ Production-Ready Architecture

  • Type Safety: Full mypy strict mode type checking
  • Comprehensive Testing: 90%+ test coverage with unit and integration tests
  • Structured Logging: Detailed observability with structlog
  • Error Handling: Robust retry mechanisms and circuit breakers
  • Configuration Management: Hydra-based hierarchical configuration system

๐ŸŽจ User-Friendly Interface

  • Gradio Web App: Beautiful, interactive web interface
  • Real-time Progress: Live updates on research progress
  • Analyst Review: Interactive analyst approval workflow
  • Report Download: One-click download of final reports

๐Ÿ”’ Security & Quality

  • Automated CI/CD: GitHub Actions workflows for testing and deployment
  • Security Scanning: 6 security tools for vulnerability detection
  • Dependency Management: Automated updates via Dependabot
  • Code Quality: Enforced via black, isort, flake8, and ruff

๐Ÿ›๏ธ Architecture

System Design

The Research Assistant follows a multi-agent graph-based architecture built on LangGraph:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Research Graph Flow                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                START โ†’ create_analysts
                              โ”‚
                    human_feedback (optional)
                              โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚                     โ”‚
          conduct_interview (Analyst 1)  conduct_interview (Analyst 2)
                   โ”‚                     โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚               โ”‚               โ”‚
      write_introduction  write_sections  write_conclusion
              โ”‚               โ”‚               โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                      finalize_report
                              โ”‚
                            END

Interview Graph (Per Analyst)

Each analyst executes a structured interview process:

START โ†’ ask_question
            โ”‚
      โ”Œโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”
      โ”‚           โ”‚
   search_web  search_wikipedia (parallel)
      โ”‚           โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚
     answer_question
            โ”‚
      route (continue OR complete)
            โ”‚
     save_interview
            โ”‚
          END

Core Components

1. State Management

  • InterviewState: Manages individual analyst interview sessions
  • ResearchGraphState: Coordinates overall research workflow
  • Type-Safe: Pydantic models with runtime validation

2. Node Functions

  • analyst_nodes.py: Analyst generation and management
  • interview_nodes.py: Question asking, answering, and routing
  • report_nodes.py: Report section generation and finalization

3. Graph Builders

  • interview_graph.py: Individual analyst interview orchestration
  • research_graph.py: Multi-analyst research coordination

4. Tools & Utilities

  • search.py: Web and Wikipedia search integration
  • logging.py: Structured logging with context
  • retry.py: Retry mechanisms and circuit breakers
  • formatting.py: Report formatting utilities

๐Ÿ“ Project Structure

research-assistant/
โ”œโ”€โ”€ .github/                           # GitHub configuration
โ”‚   โ”œโ”€โ”€ workflows/                     # CI/CD workflows
โ”‚   โ”‚   โ”œโ”€โ”€ tests.yml                 # Testing pipeline
โ”‚   โ”‚   โ”œโ”€โ”€ security.yml              # Security scanning
โ”‚   โ”‚   โ”œโ”€โ”€ release.yml               # Release automation
โ”‚   โ”‚   โ””โ”€โ”€ pr.yml                    # PR validation
โ”‚   โ”œโ”€โ”€ dependabot.yml                # Dependency updates
โ”‚   โ”œโ”€โ”€ SETUP_GUIDE.md                # CI/CD setup guide
โ”‚   โ””โ”€โ”€ CI_CD_DOCUMENTATION.md        # Full CI/CD docs
โ”‚
โ”œโ”€โ”€ app/                              # Web application
โ”‚   โ”œโ”€โ”€ gradio_app.py                 # Gradio web interface
โ”‚   โ”œโ”€โ”€ launch.sh                     # Unix launch script
โ”‚   โ””โ”€โ”€ requirements.txt              # UI dependencies
โ”‚
โ”œโ”€โ”€ src/research_assistant/           # Main source code
โ”‚   โ”œโ”€โ”€ config/                       # Configuration management
โ”‚   โ”‚   โ”œโ”€โ”€ config.py                 # Config loader
โ”‚   โ”‚   โ”œโ”€โ”€ default.yaml              # Default settings
โ”‚   โ”‚   โ”œโ”€โ”€ llm/                      # LLM configs
โ”‚   โ”‚   โ”œโ”€โ”€ search/                   # Search configs
โ”‚   โ”‚   โ”œโ”€โ”€ experiment/               # Experiment presets
โ”‚   โ”‚   โ””โ”€โ”€ topic/                    # Topic-specific configs
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ core/                         # Core data structures
โ”‚   โ”‚   โ”œโ”€โ”€ schemas.py                # Pydantic models
โ”‚   โ”‚   โ””โ”€โ”€ state.py                  # State definitions
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ nodes/                        # Graph node functions
โ”‚   โ”‚   โ”œโ”€โ”€ analyst_nodes.py          # Analyst operations
โ”‚   โ”‚   โ”œโ”€โ”€ interview_nodes.py        # Interview logic
โ”‚   โ”‚   โ””โ”€โ”€ report_nodes.py           # Report generation
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ graphs/                       # Graph builders
โ”‚   โ”‚   โ”œโ”€โ”€ interview_graph.py        # Single interview
โ”‚   โ”‚   โ””โ”€โ”€ research_graph.py         # Full research
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ tools/                        # External integrations
โ”‚   โ”‚   โ””โ”€โ”€ search.py                 # Search tools
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ prompts/                      # LLM prompts
โ”‚   โ”‚   โ”œโ”€โ”€ analyst_prompts.py        # Analyst generation
โ”‚   โ”‚   โ”œโ”€โ”€ interview_prompts.py      # Interview questions
โ”‚   โ”‚   โ””โ”€โ”€ report_prompts.py         # Report writing
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ types/                        # Type definitions
โ”‚   โ”‚   โ”œโ”€โ”€ protocols.py              # Type protocols
โ”‚   โ”‚   โ””โ”€โ”€ validation.py             # Runtime validation
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ utils/                        # Utility functions
โ”‚       โ”œโ”€โ”€ logging.py                # Structured logging
โ”‚       โ”œโ”€โ”€ retry.py                  # Retry logic
โ”‚       โ”œโ”€โ”€ exceptions.py             # Custom exceptions
โ”‚       โ””โ”€โ”€ formatting.py             # Formatters
โ”‚
โ”œโ”€โ”€ tests/                            # Test suite
โ”‚   โ”œโ”€โ”€ conftest.py                   # Shared fixtures
โ”‚   โ”œโ”€โ”€ unit/                         # Unit tests
โ”‚   โ”‚   โ”œโ”€โ”€ test_schemas.py
โ”‚   โ”‚   โ””โ”€โ”€ test_nodes.py
โ”‚   โ””โ”€โ”€ integration/                  # Integration tests
โ”‚       โ””โ”€โ”€ test_graph_execution.py
โ”‚
โ”œโ”€โ”€ pyproject.toml                    # Project metadata
โ”œโ”€โ”€ environment.yaml                  # Conda environment
โ”œโ”€โ”€ Makefile                          # Common commands
โ”œโ”€โ”€ pytest.ini                        # Pytest configuration
โ”œโ”€โ”€ coverage.toml                     # Coverage settings
โ”œโ”€โ”€ TESTING_GUIDE.md                  # Testing documentation
โ”œโ”€โ”€ TYPE_CHECKING_GUIDE.md            # Type checking guide
โ””โ”€โ”€ README.md                         # This file

๐Ÿ”ง Prerequisites

System Requirements

  • Python: 3.10, 3.11, or 3.12
  • Operating System: Linux, macOS, or Windows
  • Memory: 4GB RAM minimum, 8GB recommended
  • Storage: 1GB free space

Accounts & Authentication

You'll need API keys from the following services:

Required

  • OpenAI API or Anthropic API: For LLM access

    • Sign up: OpenAI or Anthropic
    • Generate API key in account settings
    • Free tier available for testing
  • Tavily API: For web search

    • Sign up: Tavily
    • Get API key from dashboard
    • Free tier: 1,000 searches/month

Optional

  • LangSmith: For LLM tracing and debugging

Python Dependencies

All dependencies are managed via pyproject.toml:

  • LangChain: LLM orchestration framework
  • LangGraph: Graph-based workflow engine
  • Pydantic: Data validation and settings
  • Gradio: Web interface framework
  • Hydra: Configuration management
  • structlog: Structured logging

๐Ÿ“ฅ Installation

Option 1: Quick Install (Recommended)

# Clone the repository
git clone https://github.com/yourusername/research-assistant.git
cd research-assistant

# Install with pip
pip install -e ".[dev]"

# Or with uv (faster)
uv pip install -e ".[dev]"

Option 2: Conda Environment

# Create environment from file
conda env create -f environment.yaml

# Activate environment
conda activate research-assistant

# Install package
pip install -e ".[dev]"

Option 3: Virtual Environment

# Create virtual environment
python -m venv venv

# Activate (Linux/Mac)
source venv/bin/activate

# Activate (Windows)
venv\Scripts\activate

# Install dependencies
pip install -e ".[dev]"

Verify Installation

# Check Python version
python --version  # Should be 3.10+

# Verify installation
python -c "from src.research_assistant import __version__; print(__version__)"

# Run tests
pytest tests/ -v

# Check type safety
mypy src/

โš™๏ธ Configuration

Environment Variables

Create a .env file in the project root:

# Copy the example file
cp .env.example .env

# Edit with your API keys
nano .env

Required variables:

# LLM Provider (choose one)
OPENAI_API_KEY=sk-...              # OpenAI API key
ANTHROPIC_API_KEY=sk-ant-...       # Anthropic API key

# Search Provider
TAVILY_API_KEY=tvly-...            # Tavily API key

# Optional: LangSmith Tracing
LANGCHAIN_TRACING_V2=true          # Enable tracing
LANGCHAIN_API_KEY=ls__...          # LangSmith API key
LANGCHAIN_PROJECT=research-assistant  # Project name

Configuration System

The project uses Hydra for hierarchical configuration management:

Base Configuration (config/default.yaml)

# Default research settings
max_analysts: 3
max_interview_turns: 2
report_structure:
  include_methodology: true
  include_citations: true
  
llm:
  model: gpt-4-turbo-preview
  temperature: 0.7
  max_tokens: 4000

search:
  max_results: 5
  include_domains: []
  exclude_domains: []

LLM Configurations (config/llm/)

  • openai.yaml: OpenAI GPT-4 settings
  • openai_gpt4_turbo.yaml: GPT-4 Turbo optimized
  • anthropic.yaml: Claude 3 settings
  • local.yaml: Local LLM configuration
  • cheap.yaml: Budget-friendly options

Search Configurations (config/search/)

  • default.yaml: Balanced search strategy
  • comprehensive.yaml: Maximum depth and breadth
  • minimal.yaml: Quick, surface-level searches
  • no_cache.yaml: Disable caching for fresh results

Experiment Presets (config/experiment/)

  • quick_test.yaml: Fast testing (1 analyst, 1 turn)
  • comprehensive.yaml: Deep research (5 analysts, 3 turns)
  • budget_friendly.yaml: Cost-optimized settings
  • production.yaml: Production-ready defaults
  • local_llm.yaml: Local LLM configuration

Usage with Overrides

# Use specific LLM
python -m research_assistant llm=anthropic

# Use comprehensive search
python -m research_assistant search=comprehensive

# Combine multiple configs
python -m research_assistant llm=cheap search=minimal experiment=quick_test

# Override specific values
python -m research_assistant max_analysts=5 max_interview_turns=3

# Topic-specific preset
python -m research_assistant topic=ai_safety

๐Ÿš€ Quick Start

Basic Usage

from src.research_assistant.graphs.research_graph import run_research

# Define your research topic
topic = "The impact of large language models on education"

# Run research with defaults
final_report = run_research(
    topic=topic,
    max_analysts=3,
    max_interview_turns=2
)

# Access the report
print(final_report["final_report"])

With Configuration

from src.research_assistant.config.config import load_config
from src.research_assistant.graphs.research_graph import create_research_system

# Load configuration
cfg = load_config(overrides=["llm=anthropic", "search=comprehensive"])

# Create research system
research_system = create_research_system(cfg)

# Execute research
result = research_system.invoke({
    "topic": "Quantum computing applications in drug discovery",
    "max_analysts": 4,
    "max_interview_turns": 3
})

Streaming Updates

from src.research_assistant.graphs.research_graph import stream_research

# Stream research progress
for update in stream_research(
    topic="Renewable energy storage solutions",
    max_analysts=3
):
    stage = update.get("stage", "unknown")
    progress = update.get("progress", 0)
    print(f"Stage: {stage} | Progress: {progress}%")

With Human Feedback

from src.research_assistant.graphs.research_graph import (
    create_research_system,
    continue_research
)

# Create system with checkpointing
research_system = create_research_system(cfg, enable_interrupt=True)

# Start research (will interrupt after analyst generation)
result = research_system.invoke({"topic": "AI ethics"})

# Review analysts
analysts = result["analysts"]
for analyst in analysts:
    print(f"{analyst.name}: {analyst.role} - {analyst.affiliation}")

# Provide feedback
feedback = "Approve"  # or provide specific feedback

# Continue research
final_result = continue_research(
    research_system,
    feedback=feedback,
    checkpointer=checkpointer
)

๐Ÿ’ป Usage Examples

Example 1: Quick Research

# Using the CLI
python -m research_assistant \
  --topic "Blockchain scalability solutions" \
  --analysts 2 \
  --turns 2 \
  --output report.md

Example 2: Comprehensive Analysis

from src.research_assistant import ResearchAssistant

# Initialize assistant
assistant = ResearchAssistant(
    llm_config="gpt-4-turbo",
    search_config="comprehensive"
)

# Conduct in-depth research
report = assistant.research(
    topic="Climate change adaptation strategies in coastal cities",
    num_analysts=5,
    interview_depth=3,
    enable_human_review=True
)

# Export report
assistant.export_report(report, "climate_adaptation_report.pdf")

Example 3: Academic Literature Review

from src.research_assistant.presets import academic_research

# Use academic preset
report = academic_research(
    research_question="What are the current limitations of transformer models?",
    focus_areas=["architecture", "training", "inference"],
    include_citations=True,
    citation_style="APA"
)

Example 4: Market Research

from src.research_assistant.presets import market_research

# Analyze market trends
report = market_research(
    industry="Electric Vehicles",
    regions=["North America", "Europe", "Asia"],
    timeframe="2020-2024",
    include_competitors=True
)

๐ŸŒ Web Interface

Launch the Gradio App

# Simple launch
python app/gradio_app.py

# Or use launch script (Linux/Mac)
./app/launch.sh

# Windows
app\launch.bat

# With options
python app/gradio_app.py --port 8080 --share

Interface Features

The web interface provides:

  1. Research Configuration

    • Topic input
    • Analyst count (1-10)
    • Interview depth (1-5)
    • Configuration presets
  2. Analyst Review

    • View generated analysts
    • Provide feedback
    • Approve or regenerate
  3. Real-time Progress

    • Progress bar (0-100%)
    • Stage descriptions
    • Per-analyst tracking
    • Duration estimates
  4. Results Display

    • Formatted report preview
    • Download as Markdown
    • Share link
  5. Help & Tips

    • Step-by-step guide
    • Best practices
    • Example topics

Access the Interface

Open your browser and navigate to:

http://localhost:7860

๐Ÿงช Testing

Run Tests

# Run all tests
pytest tests/

# Run with coverage
pytest tests/ --cov=src --cov-report=html

# Run specific test file
pytest tests/unit/test_schemas.py -v

# Run with markers
pytest tests/ -m "not slow"

# Run integration tests only
pytest tests/integration/ -v

Test Structure

tests/
โ”œโ”€โ”€ conftest.py              # Shared fixtures
โ”œโ”€โ”€ unit/                    # Unit tests (fast, isolated)
โ”‚   โ”œโ”€โ”€ test_schemas.py     # Pydantic model tests
โ”‚   โ””โ”€โ”€ test_nodes.py       # Node function tests
โ””โ”€โ”€ integration/            # Integration tests (slower)
    โ””โ”€โ”€ test_graph_execution.py  # End-to-end workflow tests

Coverage Goals

  • Target: 80%+ coverage
  • Current: 90%+ coverage
  • Minimum: 70% for new code

View coverage report:

pytest tests/ --cov=src --cov-report=html
open htmlcov/index.html

Test Fixtures

Common fixtures available in conftest.py:

  • mock_llm: Mocked LLM responses
  • mock_search: Mocked search results
  • sample_analyst: Pre-configured analyst
  • sample_state: Pre-configured state
  • temp_config: Temporary config file

See TESTING_GUIDE.md for comprehensive testing documentation.


๐Ÿ”„ CI/CD

Automated Workflows

GitHub Actions workflows automatically:

Tests (tests.yml)

  • โœ… Run linting (flake8, black, isort, ruff)
  • โœ… Execute tests on Python 3.10, 3.11, 3.12
  • โœ… Generate coverage reports
  • โœ… Type check with mypy

Security (security.yml)

  • ๐Ÿ”’ Scan for vulnerabilities (Safety, pip-audit)
  • ๐Ÿ”’ Detect secrets (TruffleHog)
  • ๐Ÿ”’ Analyze code security (Bandit, Semgrep, CodeQL)
  • ๐Ÿ”’ Check license compliance

Release (release.yml)

  • ๐Ÿ“ฆ Create GitHub releases
  • ๐Ÿ“ฆ Publish to PyPI
  • ๐Ÿ“ฆ Build Docker images
  • ๐Ÿ“ฆ Generate changelogs

PR Validation (pr.yml)

  • ๐Ÿท๏ธ Auto-label PRs
  • ๐Ÿ’ฌ Post coverage comments
  • โœ… Enforce conventional commits
  • ๐Ÿ” Review dependencies

Local CI Commands

# Run all checks locally
make test-all

# Individual checks
make lint
make format
make type-check
make test
make coverage

# Fix issues
make format-fix

CI/CD Documentation


๐Ÿ‘จโ€๐Ÿ’ป Development

Setting Up Development Environment

# Clone repository
git clone https://github.com/yourusername/research-assistant.git
cd research-assistant

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Verify setup
make verify

Development Workflow

  1. Create a branch

    git checkout -b feat/your-feature
    
  2. Make changes

    • Write code following style guide
    • Add tests for new features
    • Update documentation
  3. Run checks

    make lint
    make test
    make type-check
    
  4. Commit changes

    git commit -m "feat: add new feature"
    

    Follow Conventional Commits

  5. Push and create PR

    git push origin feat/your-feature
    

Code Style

  • Formatting: black (line length: 100)
  • Import sorting: isort
  • Linting: flake8, ruff
  • Type checking: mypy (strict mode)
  • Docstrings: Google style

Run formatters:

make format-fix

Adding New Features

1. Add a New Node

# src/research_assistant/nodes/your_nodes.py
from src.research_assistant.core.state import YourState

def your_node(state: YourState) -> dict:
    """Your node description.
    
    Args:
        state: The current state
        
    Returns:
        Updated state dict
    """
    # Your logic here
    return {"key": "value"}

2. Update Graph

# src/research_assistant/graphs/your_graph.py
from langgraph.graph import StateGraph
from src.research_assistant.nodes.your_nodes import your_node

def build_your_graph() -> StateGraph:
    graph = StateGraph(YourState)
    graph.add_node("your_node", your_node)
    # Add edges...
    return graph.compile()

3. Add Tests

# tests/unit/test_your_nodes.py
def test_your_node(mock_llm):
    state = {"initial": "state"}
    result = your_node(state)
    assert result["key"] == "expected"

4. Update Documentation

  • Add docstrings
  • Update README if needed
  • Add usage examples

Debugging

Enable Debug Logging

import os
os.environ["LOG_LEVEL"] = "DEBUG"

from src.research_assistant.utils.logging import get_logger
logger = get_logger(__name__)

LangSmith Tracing

export LANGCHAIN_TRACING_V2=true
export LANGCHAIN_API_KEY=your_key
export LANGCHAIN_PROJECT=your_project

View traces at smith.langchain.com

Graph Visualization

from src.research_assistant.graphs.research_graph import create_research_system

system = create_research_system(cfg)
system.get_graph().draw_mermaid_png(output_file="graph.png")

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

Types of Contributions

  • ๐Ÿ› Bug reports: Open an issue with details
  • ๐Ÿ’ก Feature requests: Describe your idea in an issue
  • ๐Ÿ“ Documentation: Improve or fix documentation
  • ๐Ÿ”ง Code: Submit pull requests
  • ๐Ÿงช Tests: Add or improve test coverage
  • ๐ŸŒ Translations: Help translate the interface

Contribution Process

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feat/amazing-feature
    
  3. Make your changes
    • Follow code style guidelines
    • Add tests for new features
    • Update documentation
  4. Run checks
    make test-all
    
  5. Commit using conventional commits
    git commit -m "feat: add amazing feature"
    
  6. Push to your fork
    git push origin feat/amazing-feature
    
  7. Open a Pull Request
    • Describe your changes
    • Reference any related issues
    • Wait for review

Commit Message Convention

Follow Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions/changes
  • chore: Maintenance tasks
  • ci: CI/CD changes

Examples:

feat(search): add DuckDuckGo search provider
fix(report): correct citation formatting
docs: update installation instructions
test: add integration tests for interview graph

Code Review Process

  • All PRs require at least one approval
  • CI checks must pass
  • Code coverage should not decrease
  • Follow style guidelines

Community Guidelines

  • Be respectful and inclusive
  • Provide constructive feedback
  • Help others learn and grow
  • Follow the Code of Conduct

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License Summary

โœ… Permitted:

  • Commercial use
  • Modification
  • Distribution
  • Private use

โŒ Forbidden:

  • Liability
  • Warranty

๐Ÿ“‹ Required:

  • License and copyright notice

๐Ÿ™ Acknowledgments

Frameworks & Libraries

Services

Inspiration

  • Research assistant patterns from academic literature
  • Multi-agent system designs from AI research
  • LangChain community examples and tutorials

Contributors

Thanks to all contributors who have helped improve this project!


๐Ÿ’ฌ Support

Documentation

Getting Help

Community

FAQ

Q: How much does it cost to run? A: Costs depend on your LLM provider and usage. Budget-friendly configs available.

Q: Can I use local LLMs? A: Yes! Use the llm=local configuration.

Q: How long does research take? A: 2-5 minutes for 2-3 analysts, 5-8 minutes for 5 analysts.

Q: Can I customize the report format? A: Yes, modify report templates in src/research_assistant/prompts/report_prompts.py.

Q: Is there a hosted version? A: Not yet, but you can deploy it yourself using Docker or cloud platforms.


๐Ÿšจ Status & Roadmap

Current Status

๐ŸŸข Active Development - Version 0.1.0

Note: This project is in active development. Features, APIs, and documentation are subject to change. For questions, issues, or contributions, please open an issue or pull request on GitHub.

Recent Updates

  • โœ… Multi-agent research system
  • โœ… Gradio web interface
  • โœ… Comprehensive test suite
  • โœ… CI/CD pipeline
  • โœ… Type safety with mypy
  • โœ… Structured logging

Roadmap

v0.2.0 (Next Release)

  • PDF export support
  • Report templates
  • Cost tracking
  • Performance metrics dashboard

v0.3.0

  • Database integration for history
  • RAG enhancement
  • Multi-language support
  • Advanced citation management

v1.0.0

  • Production-ready release
  • Docker deployment
  • API server
  • Cloud hosting guide

Contributing to Roadmap

Have ideas? Open a feature request!


๐Ÿ“Š Project Stats

GitHub stars GitHub forks GitHub watchers

GitHub issues GitHub pull requests GitHub last commit GitHub contributors


๐ŸŽ‰ Ready to Get Started?

  1. Install the package

    pip install -e ".[dev]"
    
  2. Set up your environment

    cp .env.example .env
    # Add your API keys to .env
    
  3. Launch the web interface

    python app/gradio_app.py
    
  4. Start researching! ๐Ÿ”ฌ


Built with โค๏ธ using LangChain and LangGraph

โญ Star on GitHub | ๐Ÿ› Report Bug | ๐Ÿ’ก Request Feature

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_research_assistant-0.2.0.tar.gz (114.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_research_assistant-0.2.0-py3-none-any.whl (114.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_research_assistant-0.2.0.tar.gz.

File metadata

  • Download URL: ai_research_assistant-0.2.0.tar.gz
  • Upload date:
  • Size: 114.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_research_assistant-0.2.0.tar.gz
Algorithm Hash digest
SHA256 62110642e76018f8463adc78e5f30a7b50081541a468caf3c9cd65cea5f90c28
MD5 95fbd23d1aac1495719df2b4bbf861c9
BLAKE2b-256 160e43a90b922cb1438cf251d9382125ae7cd01f7e7abfebfba0f73dd7adf040

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_research_assistant-0.2.0.tar.gz:

Publisher: publish-pypi-package.yml on chrisjcc/research_assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_research_assistant-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_research_assistant-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b12c3b797fd87ba7f9871a3763cfb76aded537bc8f7702dff7b82611453639
MD5 3bd075a7a77dfe10ea8640de8a88cc64
BLAKE2b-256 07e9e606934786a638f054be366b5cdd2718b8733490a62a4b005ad46b5deb09

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_research_assistant-0.2.0-py3-none-any.whl:

Publisher: publish-pypi-package.yml on chrisjcc/research_assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page