| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 |
- 알고리즘
- 강화학습
- JSX
- useCallback
- 수학
- 반응형 웹
- c
- React.memo
- skt membership
- 포토샵
- 소수
- box-sizing
- react
- Javascript
- Photoshop
- 미디어 쿼리
- grid
- spring
- useMemo
- 백준
- Codility
- SK바이오사이언스
- c++
- CSS
- pandas
- Reverse Proxy
- React 성능 최적화
- 통신사할인
- 프론트엔드
- Nginx
- Today
- Total
목록전체 글 (506)
sliver__
RAG(Retrieval-Augmentated Generation)LLM에게 질문을 해서 답변을 얻는다. 하지만 사내 정보나 개인 정보는 LLM이 알 수 없다.그러면 어떻게 해야할까?LLM에게 사내 정보 또는 개인 정보를 context에 함께 주면 된다.그러면 똑똑한 LLM이 context 내용을 기반으로 답변을 잘 작성해줄 것이다. 유저가 query를 날리면 query 기반으로 vectorstore를 Retrieval하여 query와 함께 context에 Augmentated하고 LLM이 context 기반으로 Generation한다.IngestionRAG를 동작하게 하려면 개인 정보가 담긴 문서가 있어야 한다.하지만 문서가 많다면 모든 정보를 context에 넘길 수 없다.이 문제를 해결하기 위해 v..
ReAct (Reasoning + Act)이번엔 json schema으로 등록한 tool들의 loop를 실제로 어떻게 파싱하는지 확인해본다. langchain의 창시자가 만든 React prompt이다. https://smith.langchain.com/hub/hwchase17/react?organizationId=8f9bb529-ac78-4d76-8c53-f3d662e3d4a3 LangSmithView in LangSmithsmith.langchain.com Template은 아래와 같다.Answer the following questions as best you can. You have access to the following tools:{tools}Use the following format:Qu..
tool을 사용하려면 @tool decorator로 썼다.이번엔 @tool이 실제로 어떻게 동작하는지 알아보자. Ollama에 맞춘 코드다.다른 vendor를 쓴다면 지원하는 schema을 확인하자.from dotenv import load_dotenvload_dotenv()import ollamafrom langsmith import traceableMAX_ITERATIONS = 10MODEL = "qwen3:8b"# --- Tools (LangChain @tool decorator) ---# tool 대신 traceable로 langsmith에서 tool로 보이게 수정@traceable(run_type="tool")def get_product_price(product: str) -> float: ..
Agent는 아래 단계로 수행한다.1. Query2. Thought and tools call3. AnswerModel 성능이 좋으면 유저 query decomposition이 잘 일어나고 단계에 따라 tool을 잘 수행할 것이다.그리고 agent context도 잘 유지해서 좋은 답변을 할 수 있다.이 과정들을 하나씩 구현해보자아래 예제는 tool을 하나씩 호출한다는 가정하게 [0]번만 선택한다.10번을 돌고 LLM이 tool을 선택하지 않으면 content를 반환한다.10번을 돌았는데도 tool을 선택하고 있으면 결론이 안나서 실패처리한다.from dotenv import load_dotenvload_dotenv()from langchain_ollama import ChatOllamafrom lang..
에이전트를 만들고 tools을 주면 agent가 query에 맞게 판단하고 자유롭게 검색이 가능하다.아래 코드 예시를 보자from dotenv import load_dotenvfrom typing import Listfrom pydantic import BaseModel, Fieldload_dotenv()from langchain.agents import create_agentfrom langchain.tools import toolfrom langchain_core.messages import HumanMessagefrom langchain_ollama import ChatOllamafrom langchain_tavily import TavilySearchfrom tavily import TavilyC..
대 AI 시대에 나는 거꾸로간다 !아예 기초 지식이 없어 react natvie 스터디를 시작하려고 한다.흠.. 앱 개발 공부하고 원하는 주제로 만들어보는게 목표다.요새 개발을 직접하지 않으니 코드 볼 일이 줄고, 코드 볼 일이 줄어드니 점점 퇴화되고 있다는 걸 느낀다.감을 살리고 싶은데 굳이 해야하나 싶고, 안하자니 멍청해지는 것 같고.. 과도기다.그래도 시작해보자..!프로젝트를 새로 만들었다.expo, react native cli 두 가지 방법으로 만들 수 있다.expo는 지원해주는게 많아 react native cli 보다 간단하게 개발이 가능한 것 같다.추후에 expo -> react native로 변경이 가능하다고 하니 expo로 선택했다. https://reactnative.dev/docs/..