Skip to content

dalianmao000/KnowStrat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consulting Researcher Multi-Agent System

A LangGraph-based multi-agent collaboration system covering three core business flows: research, project bidding, and survey/meeting support.

Project Status

Completed Features

Module Feature Status Notes
Core Central State (ResearchState) ✅ Done TaskType, ReviewStage, ReviewResult enums
Core Supervisor Agent ✅ Done Task routing, WBS decomposition, result summarization
Agent Research Agent ✅ Done Policy search, industry data, outline generation
Agent Writing Agent ✅ Done Report generation, chart, formatting
Agent Project Agent ✅ Done Tender parsing, qualification matching, tender docs
Agent Knowledge Agent ✅ Done Knowledge storage, retrieval, policy tracking
Node Human Review Node ✅ Done Review stages, approval/rejection flow
Flow Research Flow ✅ Done Full research → report pipeline
Flow Project Flow ✅ Done Tender → qualification → tender docs
Flow Survey Flow ✅ Done Planning → meeting → summary
Infra CLI Entry Point ✅ Done --flow, --input, --tender, --region
Infra Docker Compose ✅ Done Milvus local deployment
Tests Unit Tests ✅ Done TDD approach, all passing

Future Development

Priority Module Description Difficulty
P0 Real RAG Integration Replace mock data with actual Milvus + policy/industry documents Medium
P0 Human Review UI Web interface for manual review at approval nodes High
P1 LLM API Integration Connect to Zhipu GLM / Qwen APIs (currently mocked) Medium
P1 PDF Tender Parser Implement real PDF parsing with pdfplumber Medium
P1 Space Analysis ArcGIS/QGIS integration for spatial analysis High
P2 Dify/CrewAI Migration Migrate from raw LangGraph to orchestration platforms Low
P2 Model Fine-tuning Fine-tune on historical consulting reports High
P2 Multi-language Support English/Chinese report generation Low

System Architecture

┌─────────────────────────────────────────────────────────────┐
│                     Central State (LangGraph)                │
│         research_state = {task, context, artifacts}         │
└─────────────────────────────────────────────────────────────┘
                              │
                    ┌─────────┴─────────┐
                    ▼                   ▼
         ┌──────────────────┐   ┌──────────────────┐
         │  Supervisor      │   │  Human Review   │
         │  (Plan/Route/Coor)│   │  (Approve/Reject)│
         └────────┬─────────┘   └──────────────────┘
                  │
       ┌──────────┼──────────┬──────────┐
       ▼          ▼          ▼          ▼
   ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
   │Research│ │Writing │ │Project │ │Knowledge│
   │ Agent  │ │ Agent  │ │ Agent  │ │ Agent  │
   └────────┘ └────────┘ └────────┘ └────────┘

Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Start Milvus (optional, for knowledge base)

docker-compose up -d

3. Configure Environment Variables

Create .env file:

# LLM API (choose one)
ZHIPU_API_KEY=your_zhipu_api_key
# or
QWEN_API_KEY=your_qwen_api_key

# Tavily Search (optional)
TAVILY_API_KEY=your_tavily_api_key

4. Run Workflows

# Research flow
python -m app.main --flow research --input "Analyze new energy vehicle industry trends in Yangtze River Delta"

# Project bidding flow
python -m app.main --flow project --input "Industrial park planning tender analysis" --tender /path/to/tender.pdf

# Survey/meeting flow
python -m app.main --flow survey --input "Survey industrial park transformation"

Project Structure

consulting-agent-system/
├── app/
│   ├── main.py                 # CLI entry point
│   ├── state.py                # Central State definition
│   ├── supervisor.py           # Supervisor Agent
│   ├── agents/
│   │   ├── research.py         # Research Agent
│   │   ├── writing.py          # Writing Agent
│   │   ├── project.py          # Project Agent
│   │   └── knowledge.py        # Knowledge Agent
│   ├── nodes/
│   │   └── review.py           # Human Review Node
│   └── graph/
│       ├── research_flow.py     # Research workflow
│       ├── project_flow.py      # Project bidding workflow
│       └── survey_flow.py       # Survey/meeting workflow
├── config/
│   └── settings.py             # Configuration
├── tests/                      # Unit tests (TDD)
├── requirements.txt
├── docker-compose.yml          # Milvus deployment
├── LICENSE                     # MIT License
└── README.md

Agent Responsibilities

Agent Responsibilities Core Tools
Supervisor Task decomposition, routing, result summarization LLM routing
Research Policy retrieval, industry data, outline generation RAG + Search API
Writing Report drafting, chart generation, formatting Templates + Echarts
Project Tender parsing, qualification matching, tender docs Document parsing
Knowledge Knowledge storage, retrieval, policy tracking Milvus + Neo4j

Workflows

Research Flow

User Input → Supervisor → Research Agent → Writing Agent → Human Review → Output

Project Bidding Flow

Tender File → Parse → Qualification Match → Tender Docs → Human Review → Delivery

Survey/Meeting Flow

Planning → Meeting/Interview → Minutes → Knowledge Storage → Output

Development

Run Tests

# All tests
pytest tests/ -v

# Specific modules
pytest tests/test_agents/ -v
pytest tests/test_flows/ -v

Add New Agent

  1. Create new agent file in app/agents/
  2. Implement name attribute and tools list
  3. Integrate in workflow graph under app/graph/

Tech Stack

  • Orchestration: LangGraph
  • Foundation Model: Zhipu GLM / Qwen (Cloud API)
  • Knowledge Base: Milvus (Vector Database)
  • Tools: Tavily Search, pdfplumber, Echarts

Notes

  • Prototype stage: some agents use mock data, production needs real API integration
  • Human Review node auto-approves in prototype stage
  • Python 3.11+ recommended

License

MIT License - Copyright (c) 2026 dalianmao000

About

资讯研究:基于 LangGraph 的多智能体协作系统,覆盖咨询研究、项目申报、调研会议三大核心业务流。

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors