{"id":48845271,"url":"https://github.com/sehaim/battery-strategy-agent","last_synced_at":"2026-04-15T05:01:36.752Z","repository":{"id":345219957,"uuid":"1184801737","full_name":"sehaim/battery-strategy-agent","owner":"sehaim","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-18T05:11:05.000Z","size":10278,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T21:36:02.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sehaim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T00:19:03.000Z","updated_at":"2026-03-18T05:11:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sehaim/battery-strategy-agent","commit_stats":null,"previous_names":["sehaim/battery-strategy-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sehaim/battery-strategy-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehaim%2Fbattery-strategy-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehaim%2Fbattery-strategy-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehaim%2Fbattery-strategy-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehaim%2Fbattery-strategy-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sehaim","download_url":"https://codeload.github.com/sehaim/battery-strategy-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehaim%2Fbattery-strategy-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31826902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-15T05:01:35.929Z","updated_at":"2026-04-15T05:01:36.742Z","avatar_url":"https://github.com/sehaim.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 배터리 시장 전략 분석 Agent\n\n\u003e LG에너지솔루션 vs CATL 포트폴리오 다각화 전략 비교 분석 보고서 자동 생성 시스템\n\n## Overview\n\n- **Objective**: 전기차 캐즘 국면에서 LG에너지솔루션·CATL의 전략을 조사·분석해 배터리 업계 의사결정자가 활용할 수 있는 비교 분석 보고서 자동 생성\n- **Method**: Supervisor Pattern 기반 Multi-Agent + Agentic RAG + 확증 편향 방지 웹서치\n- **Tools**: LangGraph, LangChain, FAISS, multilingual-e5-large, Tavily\n\n## Features\n\n- PDF 문서 기반 RAG (LG / CATL 벡터스토어 물리적 분리 — Context Bleed 방지)\n- 확증 편향 방지: 긍정·비판 이중 쿼리 + 출처 다양성 필터 + Devil's Advocate 프롬프트 + Reflect Balance Audit\n- Agentic RAG: Query Transformation → Grade Documents → Hallucination Check 순환\n- Reflect Agent: Success Criteria 기반 PASS/FAIL 자동 품질 검토\n- 에러 핸들링: 에러 유형 분류(timeout / empty_retrieval / parsing_error) → retry(max 2) → fallback\n\n## Tech Stack\n\n| Category  | Details                               |\n|-----------|---------------------------------------|\n| Framework | LangGraph, LangChain, Python          |\n| LLM       | GPT-4o-mini via OpenAI API            |\n| Retrieval | FAISS (IndexFlatIP)                   |\n| Embedding | intfloat/multilingual-e5-large (오픈소스) |\n| Web Search| Tavily (fallback: DuckDuckGo)         |\n| Output    | Markdown + PDF (reportlab)            |\n\n## Agents\n\n| Agent | 단일 책임 |\n|---|---|\n| Supervisor | current_step 기반 라우팅 · 재시도 · 종료 판단 |\n| LG RAG Agent | data/lg/ PDF 전용 검색·분석 |\n| CATL RAG Agent | data/catl/ PDF 전용 검색·분석 |\n| Web Search Agent | 이중 쿼리 웹서치 + 출처 다양성 필터 |\n| Aggregator | 3개 결과 병합만 담당 |\n| SWOT Agent | 내부(S/W) + 외부(O/T) 4분면 생성 |\n| Insight Agent | 비교 분석 · 시사점 도출 |\n| Reflect Agent | Success Criteria 기반 PASS/FAIL |\n| Report Writer | Markdown 보고서 생성 + PDF 변환 |\n| Error Handler | retry · fallback 전환 |\n\n## Architecture\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/architecture.png\" alt=\"Architecture\" width=600px/\u003e\n\u003c/p\u003e\n\n## Directory Structure\n\n```\nbattery-agent/\n├── data/\n│   ├── lg/              # LG 전용 PDF\n│   ├── catl/            # CATL 전용 PDF\n│   └── market/          # 시장 배경 보고서\n├── agents/              # 에이전트 모듈\n├── retrieval/           # PDF 로더 + FAISS 임베더\n├── prompts/             # 프롬프트 템플릿\n├── tests/               # 단위 테스트\n├── outputs/             # 생성 보고서 (MD + PDF)\n├── .cache/              # FAISS 인덱스 캐시\n├── state.py             # AgentState 정의\n├── graph.py             # LangGraph 워크플로우\n├── app.py               # CLI 실행 진입점\n├── requirements.txt\n└── .env.example\n```\n\n## 실행 방법\n\n```bash\n# 1. 환경 설정\npip install -r requirements.txt\ncp .env.example .env    # OPENAI_API_KEY, TAVILY_API_KEY 입력\n\n# 2. 실행\npython app.py\npython app.py --query \"LG에너지솔루션과 CATL의 ESS 전략 비교\"\npython app.py --rebuild-index   # 인덱스 재구축\n```\n\n## Contributors\n\n- 임세하: Agent Design, Prompt Engineering, RAG Pipeline, Graph 설계\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsehaim%2Fbattery-strategy-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsehaim%2Fbattery-strategy-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsehaim%2Fbattery-strategy-agent/lists"}