Skip to content

codeminjun/treeLLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒณ TreeLLM: AI Agent ๊ธฐ๋ฐ˜ ๋…ผ๋ฌธ ๋ถ„์„ ์‹œ์Šคํ…œ

TreeLLM์€ USENIX Guidelines๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ AI Agent ์‹œ์Šคํ…œ์„ ํ†ตํ•ด ํ•™์ˆ  ๋…ผ๋ฌธ์„ ์ž๋™ ๋ถ„์„ํ•˜๊ณ  ๊ฐœ์„  ์ œ์•ˆ์„ ์ œ๊ณตํ•˜๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.

โœจ ์ฃผ์š” ๊ธฐ๋Šฅ

๐Ÿค– Agent ๊ธฐ๋ฐ˜ ์ „๋ฌธ ๋ถ„์„

  • OriginalityAgent: USENIX Original Ideas ๊ธฐ์ค€์œผ๋กœ ๋…์ฐฝ์„ฑ ํ‰๊ฐ€
  • LessonExtractionAgent: USENIX Lessons ๊ธฐ์ค€์œผ๋กœ ๊ตํ›ˆ ์ถ”์ถœ ๋ถ„์„
  • AssumptionAgent: Method & Experiments์˜ ๊ฐ€์ •์‚ฌํ•ญ ๊ฒ€์ฆ
  • RelatedPaperComparisonAgent: ์—…๋กœ๋“œํ•œ ๊ด€๋ จ ๋…ผ๋ฌธ๊ณผ ๋น„๊ต ๋ถ„์„

๐Ÿ“‹ USENIX Guidelines ์ค€์ˆ˜

  • Original Ideas: ๋ฌธ์ œ ์ •์˜, ๊ธฐ์กด ๊ธฐ์ˆ  ํ•œ๊ณ„, ์•„์ด๋””์–ด ์ค‘์š”์„ฑ, ์ฐจ๋ณ„์„ฑ
  • Reality: ์‹ค์ œ ๊ตฌํ˜„ ์—ฌ๋ถ€, ๊ตฌํ˜„ ์™„์„ฑ๋„, ์‹ค์šฉ์  ์ค‘์š”์„ฑ
  • Lessons: ๊ตํ›ˆ ๋ช…ํ™•์„ฑ, ์ผ๋ฐ˜์  ์ ์šฉ๊ฐ€๋Šฅ์„ฑ, ์ „์ œ ์กฐ๊ฑด ๋ช…์‹œ

๐Ÿ“„ ๋‹ค์–‘ํ•œ ์ž…๋ ฅ ๋ฐฉ์‹

  • ํ…์ŠคํŠธ ์ง์ ‘ ์ž…๋ ฅ
  • PDF ํŒŒ์ผ ์ž๋™ ์„น์…˜ ์ถ”์ถœ
  • ๊ด€๋ จ ๋…ผ๋ฌธ PDF ์—…๋กœ๋“œ๋ฅผ ํ†ตํ•œ ๋น„๊ต ๋ถ„์„

๐ŸŽฏ ์ •ํ™•ํ•œ ์„น์…˜๋ณ„ ๋ถ„์„

  • Agent๋ณ„ ํ•„์š” ์„น์…˜๋งŒ ์„ ๋ณ„ ์ž…๋ ฅ (ํ† ํฐ ํšจ์œจ์„ฑ)
  • Introduction + Related Work โ†’ OriginalityAgent
  • Method + Experiments โ†’ AssumptionAgent
  • Conclusion โ†’ LessonExtractionAgent

๐Ÿš€ ๋น ๋ฅธ ์‹œ์ž‘

1. ํ™˜๊ฒฝ ์„ค์ •

# ์ €์žฅ์†Œ ํด๋ก 
git clone https://github.com/treellm/treellm.git
cd TreeLLM

# ์˜์กด์„ฑ ์„ค์น˜
pip install -r requirements.txt

# LLM API ํ‚ค ์„ค์ •
export OPENAI_API_KEY="your-openai-api-key"
# ๋˜๋Š”
export ANTHROPIC_API_KEY="your-anthropic-api-key"

2. ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•

from src.core import PaperSections
from treellm_system import TreeLLMSystem

# ๋…ผ๋ฌธ ์„น์…˜ ๋ฐ์ดํ„ฐ ์ค€๋น„
paper = PaperSections(
    introduction="๋ณธ ์—ฐ๊ตฌ๋Š”...",
    related_work="๊ธฐ์กด ์—ฐ๊ตฌ๋“ค์€...",
    method="์ œ์•ˆํ•˜๋Š” ๋ฐฉ๋ฒ•์€...",
    experiments="์‹คํ—˜ ๊ฒฐ๊ณผ...",
    conclusion="๊ฒฐ๋ก ์ ์œผ๋กœ..."
)

# TreeLLM ์‹œ์Šคํ…œ ์ดˆ๊ธฐํ™” ๋ฐ ๋ถ„์„
treellm = TreeLLMSystem()
results = treellm.analyze_paper(
    paper_sections=paper,
    selected_agents=["OriginalityAgent", "LessonExtractionAgent"]
)

# ๊ฒฐ๊ณผ ํ™•์ธ
print(f"์ „์ฒด ์ ์ˆ˜: {results['integrated_summary']['overall_score']:.2f}/5.0")

3. ์›น ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰

# Streamlit ์›น ์•ฑ ์‹คํ–‰
streamlit run web_interface.py

4. ์˜ˆ์‹œ ์ฝ”๋“œ ์‹คํ–‰

# ๋‹ค์–‘ํ•œ ์‚ฌ์šฉ ์˜ˆ์‹œ ํ™•์ธ
python example_usage.py

๐Ÿ“ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

TreeLLM/
โ”œโ”€โ”€ src/                        # ๋ฉ”์ธ ์†Œ์Šค ์ฝ”๋“œ
โ”‚   โ”œโ”€โ”€ core/                   # ํ•ต์‹ฌ ๋ชจ๋“ˆ
โ”‚   โ”‚   โ”œโ”€โ”€ data_models.py      # ๋ฐ์ดํ„ฐ ํด๋ž˜์Šค
โ”‚   โ”‚   โ”œโ”€โ”€ guideline_manager.py # USENIX ๊ฐ€์ด๋“œ๋ผ์ธ ๊ด€๋ฆฌ
โ”‚   โ”‚   โ””โ”€โ”€ section_extractor.py # Agent๋ณ„ ์„น์…˜ ๋งคํ•‘
โ”‚   โ””โ”€โ”€ agents/                 # Agent ๋ชจ๋“ˆ
โ”‚       โ”œโ”€โ”€ base_agent.py       # ๊ธฐ๋ณธ Agent ํด๋ž˜์Šค
โ”‚       โ”œโ”€โ”€ usenix_agents.py    # USENIX ์ „์šฉ Agent๋“ค
โ”‚       โ””โ”€โ”€ comparison_agents.py # ๊ด€๋ จ๋…ผ๋ฌธ ๋น„๊ต Agent
โ”œโ”€โ”€ utils/                      # ์œ ํ‹ธ๋ฆฌํ‹ฐ
โ”‚   โ”œโ”€โ”€ pdf_processor.py        # PDF ์ฒ˜๋ฆฌ
โ”‚   โ””โ”€โ”€ llm_interface.py        # LLM API ์ธํ„ฐํŽ˜์ด์Šค  
โ”œโ”€โ”€ tests/                      # ํ…Œ์ŠคํŠธ
โ”‚   โ””โ”€โ”€ test_agents.py          # Agent ํ…Œ์ŠคํŠธ
โ”œโ”€โ”€ treellm_system.py          # ๋ฉ”์ธ ์‹œ์Šคํ…œ
โ”œโ”€โ”€ example_usage.py           # ์‚ฌ์šฉ ์˜ˆ์‹œ
โ”œโ”€โ”€ web_interface.py           # Streamlit ์›น ์ธํ„ฐํŽ˜์ด์Šค
โ”œโ”€โ”€ requirements.txt           # ์˜์กด์„ฑ
โ””โ”€โ”€ setup.py                   # ํŒจํ‚ค์ง€ ์„ค์ •

๐Ÿ”ง Agent๋ณ„ ๋ถ„์„ ๋ฒ”์œ„

Agent ์ž…๋ ฅ ์„น์…˜ ๋ถ„์„ ๋‚ด์šฉ USENIX ๊ธฐ์ค€
OriginalityAgent Introduction + Related Work ๋…์ฐฝ์„ฑ, ์ฐจ๋ณ„์ , ๋ฌธ์ œ ์ •์˜ Original Ideas
LessonExtractionAgent Conclusion ๊ตํ›ˆ ์ถ”์ถœ, ์ผ๋ฐ˜ํ™” ๊ฐ€๋Šฅ์„ฑ Lessons
AssumptionAgent Method + Experiments ๊ฐ€์ •์‚ฌํ•ญ, ์ „์ œ ์กฐ๊ฑด -
RelatedPaperComparisonAgent ์ „์ฒด + ์—…๋กœ๋“œ ๋…ผ๋ฌธ ๊ด€๋ จ์—ฐ๊ตฌ ๋น„๊ต, ํฌ์ง€์…”๋‹ -

๐Ÿ’ก ์‚ฌ์šฉ ์˜ˆ์‹œ

๊ธฐ๋ณธ ๋ถ„์„

# ๊ฐ„๋‹จํ•œ ๋…ผ๋ฌธ ๋ถ„์„
results = treellm.analyze_paper(paper_sections=paper)

๊ด€๋ จ ๋…ผ๋ฌธ๊ณผ ๋น„๊ต ๋ถ„์„

# ๊ด€๋ จ ๋…ผ๋ฌธ ์ •๋ณด ์ค€๋น„
related_papers = [
    {"title": "Related Work 1", "year": 2023, "authors": ["Smith et al."]},
    {"title": "Related Work 2", "year": 2022, "authors": ["Johnson et al."]}
]

# ๋น„๊ต ๋ถ„์„ ์‹คํ–‰
results = treellm.analyze_paper(
    paper_sections=paper,
    uploaded_papers=related_papers
)

PDF ํŒŒ์ผ ๋ถ„์„

from utils.pdf_processor import PDFProcessor

# PDF์—์„œ ์„น์…˜ ์ž๋™ ์ถ”์ถœ
sections_dict = PDFProcessor.extract_sections_from_pdf("paper.pdf")
paper = PaperSections(**sections_dict)

# ๋ถ„์„ ์‹คํ–‰
results = treellm.analyze_paper(paper_sections=paper)

๐Ÿ“Š ๊ฒฐ๊ณผ ํ˜•์‹

{
  "usenix_analysis": {
    "OriginalityAgent": {
      "scores": {
        "๋ฌธ์ œ ์ •์˜ ๋ช…ํ™•์„ฑ": 4.2,
        "๊ธฐ์กด ๊ธฐ์ˆ  ํ•œ๊ณ„ ์„ค๋ช…": 3.8,
        "์•„์ด๋””์–ด ์ค‘์š”์„ฑ": 4.0,
        "๊ธฐ์กด ์—ฐ๊ตฌ์™€ ์ฐจ๋ณ„์„ฑ": 3.5
      },
      "findings": ["๋ฐœ๊ฒฌ์‚ฌํ•ญ1", "๋ฐœ๊ฒฌ์‚ฌํ•ญ2"],
      "suggestions": ["๊ฐœ์„ ์ œ์•ˆ1", "๊ฐœ์„ ์ œ์•ˆ2"]
    }
  },
  "integrated_summary": {
    "overall_score": 3.95,
    "total_suggestions": 8,
    "priority_improvements": ["์šฐ์„ ๊ฐœ์„ 1", "์šฐ์„ ๊ฐœ์„ 2"]
  }
}

๐Ÿงช ํ…Œ์ŠคํŠธ

# Agent ํ…Œ์ŠคํŠธ ์‹คํ–‰
python tests/test_agents.py

# ๋˜๋Š” pytest ์‚ฌ์šฉ
pytest tests/

๐Ÿ”— LLM ์ œ๊ณต์ž ์ง€์›

  • OpenAI GPT-4/GPT-3.5: LLMFactory.create_llm("openai")
  • Anthropic Claude: LLMFactory.create_llm("anthropic")
  • Mock LLM: ํ…Œ์ŠคํŠธ์šฉ MockLLMInterface()

๐Ÿ“ˆ ํ† ํฐ ์‚ฌ์šฉ๋Ÿ‰ ์ตœ์ ํ™”

# Agent๋ณ„ ํ† ํฐ ์‚ฌ์šฉ๋Ÿ‰ ํ™•์ธ
token_usage = treellm.get_agent_token_usage()
print(token_usage)

# ์ถœ๋ ฅ ์˜ˆ์‹œ:
# {
#   'OriginalityAgent': 3500,      # Introduction + Related Work
#   'LessonExtractionAgent': 1000, # Conclusion๋งŒ
#   'AssumptionAgent': 5500        # Method + Experiments
# }

๐Ÿค ๊ธฐ์—ฌํ•˜๊ธฐ

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ ๋ผ์ด์„ ์Šค

์ด ํ”„๋กœ์ ํŠธ๋Š” MIT ๋ผ์ด์„ ์Šค ํ•˜์— ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ LICENSE ํŒŒ์ผ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๐Ÿ‘ฅ ๊ฐœ๋ฐœํŒ€

  • TreeLLM Team - ์ดˆ๊ธฐ ๊ฐœ๋ฐœ ๋ฐ ์œ ์ง€๋ณด์ˆ˜

๐Ÿ”– ๋ฒ„์ „ ํžˆ์Šคํ† ๋ฆฌ

  • v0.1.0 - ์ดˆ๊ธฐ ๋ฆด๋ฆฌ์ฆˆ
    • USENIX Guidelines ๊ธฐ๋ฐ˜ Agent ์‹œ์Šคํ…œ
    • PDF ์ž๋™ ์ฒ˜๋ฆฌ
    • ์›น ์ธํ„ฐํŽ˜์ด์Šค
    • ๊ด€๋ จ ๋…ผ๋ฌธ ๋น„๊ต ๊ธฐ๋Šฅ

๐Ÿ“ž ์ง€์›

๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฑฐ๋‚˜ ์งˆ๋ฌธ์ด ์žˆ์œผ์‹œ๋ฉด Issues์— ๋“ฑ๋กํ•ด ์ฃผ์„ธ์š”.


TreeLLM์œผ๋กœ ๋” ๋‚˜์€ ๋…ผ๋ฌธ์„ ์ž‘์„ฑํ•˜์„ธ์š”! ๐Ÿš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors