AI·News
뒤로

메모리 검색 개선: New Computer가 LangSmith로 50% 높은 회상률을 달성한 방법

Improving Memory Retrieval: How New Computer achieved 50% higher recall with LangSmith

New Computer 소개

New Computer는 사용자를 진정으로 이해하도록 설계된 최초의 개인 AI인 Dot을 만든 팀입니다. Dot의 장기 기억 시스템은 음성 및 행동 신호를 관찰하여 시간이 지남에 따라 사용자의 선호도를 학습합니다. Dot의 기억 시스템은 단순한 회상을 넘어 사용자가 누구인지에 대한 이해를 지속적으로 진화시켜 시기적절하고 개인화된 지원을 제공하고 진정한 이해를 만들어냅니다.

LangSmith을 통해 New Computer는 메모리 검색 시스템을 테스트하고 개선할 수 있었으며, 이전 동적 메모리 검색 기본 구현과 비교하여 회상률이 50% 높아지고 정밀도가 40% 높아졌습니다.

Dot의 에이전트 메모리 개요

New Computer 팀은 혁신적이고 최초의 에이전트 메모리 시스템을 구축했습니다. 정적 문서 집합에 의존하는 표준 RAG 방법과 달리, 에이전트 메모리는 나중에만 검색될 문서를 동적으로 생성하거나 미리 계산하는 것을 포함합니다. 이는 검색을 가능하게 하고 시간이 지남에 따라 메모리가 축적될 때 정확하고 효율적이기 위해 메모리 생성 중에 정보를 구조화해야 함을 의미합니다.

원본 콘텐츠 외에도 Dot의 메모리는 검색에 유용한 선택적 '메타필드' 집합을 가지고 있습니다. 여기에는 상태(예: COMPLETED 또는 IN PROGRESS)와 시작 또는 마감일 같은 날짜/시간 필드가 포함됩니다. 이들은 "이번 주에 완료하고 싶었던 작업이 무엇입니까?"나 "오늘 완료해야 할 작업이 무엇입니까?"와 같은 검색 중 고빈도 쿼리를 위한 추가 필터 방법으로 사용될 수 있습니다.

LangSmith으로 메모리 검색 개선

다양한 검색 방법(의미론적, 키워드, BM25, 메타필드 필터 기법 중 하나 또는 여러 개)을 사용하여 New Computer는 레이블이 지정된 예제 데이터 세트에서 빠르게 반복할 수 있는 새로운 방법이 필요했습니다. 사용자 개인정보를 보호하면서 성능을 테스트하기 위해 LLM에서 생성한 배경 스토리를 가진 합성 사용자 집단을 만들어 합성 데이터를 생성했습니다. 각 합성 사용자의 메모리 데이터베이스를 초기화하기 위한 초기 대화 후 팀은 쿼리(합성 사용자의 메시지)와 LangSmith 데이터 세트의 사용 가능한 전체 메모리 집합을 저장하기 시작했습니다.

LangSmith에 연결된 내부 도구를 사용하여 New Computer 팀은 각 쿼리에 대한 관련 메모리에 레이블을 지정하고 정밀도, 회상률 및 F1과 같은 평가 지표를 정의하여 에이전트 메모리 시스템의 검색 개선을 빠르게 반복할 수 있게 했습니다.

이 실험 세트를 위해 쿼리당 가장 관련성 높은 메모리의 고정된 수를 검색하는 의미론적 검색을 사용하는 간단한 기본 시스템으로 시작했습니다. 그런 다음 다양한 쿼리 유형에 걸쳐 성능을 평가하기 위해 다른 기법들을 테스트했습니다. 어떤 경우에는 유사성 검색이나 BM25 같은 키워드 방법이 더 잘 작동했고, 다른 경우에는 이러한 방법이 효과적으로 작동하기 위해 메타필드에 의한 일부 사전 필터링이 필요했습니다.

생각할 수 있듯이 이러한 여러 방법을 병렬로 실행하면 실험이 조합론적으로 증가할 수 있으므로, 다양한 데이터 세트에서 다양한 방법을 빠르게 검증하는 것이 진행을 위해 중요합니다. LangSmith의 사용하기 쉬운 SDK와 실험 UI를 통해 New Computer는 이러한 실험의 결과를 빠르고 효율적으로 실행, 평가 및 검사할 수 있었습니다.

New Computer가 LangSmith에서 실행한 다양한 실험 전반에 걸친 F1 성능 개요

이러한 실험을 통해 New Computer는 메모리 시스템을 크게 개선할 수 있었으며, 이전 동적 메모리 검색 기본 구현과 비교하여 회상률이 50% 높아지고 정밀도가 40% 높아졌습니다.

LangSmith으로 대화 프롬프트 조정

Dot의 응답은 동적 대화 프롬프트에 의해 생성됩니다. 이는 관련 메모리를 포함하는 것 외에도 시스템이 정확하고 자연스러운 방식으로 응답하기 위해 도구 사용(예: 검색 결과)과 상황에 따른 행동 지침에 의존할 수 있음을 의미합니다.

이와 같이 변동성이 높은 시스템을 개발하는 것은 어려울 수 있습니다. 한 쿼리를 개선하는 변경이 다른 쿼리에 해로운 영향을 미칠 수 있기 때문입니다.

프롬프트를 최적화하기 위해 New Computer 팀은 다시 합성 사용자 집단을 사용하여 광범위한 의도에 대한 사용자 쿼리를 생성했습니다. 그런 다음 LangSmith의 실험 비교 보기에서 프롬프트 변경의 전체적인 영향을 쉽게 검사할 수 있었습니다. 이를 통해 프롬프트 변경에서 파생된 성능 저하를 매우 시각적인 방식으로 식별할 수 있었습니다.

또한 출력이 부정확한 실패 사례에서 팀은 내장 프롬프트 놀이터를 사용하여 LangSmith UI를 떠나지 않고도 프롬프트를 직접 조정할 수 있었습니다. 이는 대화 프롬프트를 평가하고 조정하는 동안 팀의 반복 속도를 크게 개선했습니다.

New Computer의 향후 계획

New Computer가 인간-AI 관계를 심화시키기 위해 노력함에 따라 팀은 사용자가 진정으로 인식되고 이해받는다고 느끼도록 하는 방법을 지속적으로 모색하고 있습니다. 여기에는 Dot이 사용자의 대화 또는 톤 선호도에 맞춰 조정할 수 있도록 하거나, 사용자에게 맞춤형 메시지로 자발적으로 연락하여 사용자별로 완전히 맞춤화되는 것이 포함됩니다.

최근 출시로 새로운 사용자 물결이 들어왔으며, 이들 중 45% 이상이 무료 메시지 제한에 도달한 후 앱의 유료 티어로 전환했습니다. 이들은 Dot이 시간이 지남에 따라 함께 성장하고 진화하기를 기대하고 있습니다. New Computer와 LangChain 팀의 파트너십과 LangSmith의 사용은 팀이 인간 사용자와의 관계 심화의 복잡성을 시뮬레이션하기 위해 새로운 AI 자료를 어떻게 사용하는지에 있어 계속해서 중추적인 역할을 할 것입니다.

About New Computer

New Computer is the team behind Dot, the first personal AI designed to truly understand its users. Dot’s long-term memory system learns users preferences over time by observing verbal and behavioral cues. Dot’s memory system goes beyond just recall— it constantly evolves its picture of who the user is in order to provide timely and personalized assistance, creating a perception of true understanding.

With LangSmith, New Computer has been able to test and improve their memory retrieval systems, leading to 50% higher recall and 40% higher precision compared to a previous baseline implementation of dynamic memory retrieval.

A brief overview of Dot’s agentic memory

The New Computer team has built an innovative, first-of-its-kind agentic memory system. Unlike standard RAG methods that rely on a static set of documents, agentic memory involves dynamically creating or pre-calculating documents that will only be retrieved later. This means that information must be structured during memory creation in order to make retrieval possible and, as memories accumulate over time, accurate & efficient.

In addition to the raw content, Dot’s memories have a set of optional “meta-fields” that are useful for retrieval. These include status (e.g. COMPLETED or IN PROGRESS) and datetime fields like start or due date. These can be used as additional filter methods for high-frequency queries during retrieval, such as “Which tasks did I want to get done this week?”, or “What do I have left to complete for today?”

Improving memory retrieval with LangSmith

With their diverse range of retrieval methods— one or multiple of semantic, keyword, BM25, meta-field filter techniques — New Computer needed a new way to iterate quickly on a dataset of labeled examples. To test performance while preserving user privacy, they generated synthetic data by creating a cohort of synthetic users with LLM-generated backstories. After an initial conversation to seed the memory database for each synthetic user, the team began storing queries (messages by synthetic users) along with the full set of available memories in a LangSmith dataset.

Using an in-house tool connected to LangSmith, the New Computer team labeled relevant memories for each query and defined evaluation metrics like precision, recall and F1, allowing them to quickly iterate on improving retrieval for the agentic memory system.

For this set of experiments, they started out with a simple baseline system using semantic search that retrieves a fixed number of the most relevant memories per query. They then tested other techniques to assess performance across different query types. In some cases, similarity search or keyword methods like BM25 worked better; in others, these methods required some pre-filtering by meta-fields in order to perform effectively.

As you might imagine, running these multiple methods in parallel can lead to a combinatorial explosion of experiments— thus, validating different methods quickly on a diverse dataset is crucial for making progress. LangSmith’s easy-to-use SDK and Experiments UI enabled New Computer to run, evaluate, and inspect the results of these experiments quickly and efficiently.

An overview of F1 performance across different experiments that New Computer ran in LangSmith

These experiments enabled New Computer to significantly improve their memory systems, leading to 50% higher recall and 40% higher precision compared to a previous baseline implementation of dynamic memory retrieval.

Adjusting the conversation prompt with LangSmith

Dot’s responses are generated by a dynamic conversational prompt— which means that in addition to including relevant memories, the system might also rely upon tool usage (e.g. search results) and highly-contextual behavioral instructions in order to respond in an accurate and natural way.

Developing a highly variable system like this can be challenging, as a change that improves one query can have detrimental effects on others.

To optimize the prompt, the New Computer team again used a cohort of synthetic users to generate user queries for a wide range of intents. They were then able to easily inspect the global effects of prompt changes in LangSmith’s experiment comparison view. This let them identify regressed runs derived from prompt changes in a highly-visual manner.

In addition, in failure cases where the output was inaccurate, the team could directly adjust prompts without leaving the LangSmith UI using the built-in prompt playground. This greatly improved the team’s iteration speed while evaluating and adjusting their conversation prompts.

What’s next for New Computer

As New Computer pushes to deepen human-AI relationships, the team is constantly seeking ways to make users feel truly perceived and understood. This includes enabling Dot to adapt to conversational or tonal preferences of the user, or becoming fully bespoke on a per-user basis by proactively reaching out to users with tailored messages.

Their recent launch has brought in a new wave of users— more than 45% of which converted to the app’s paid tier after hitting the free message limit— who expect Dot to grow and evolve alongside them over time. New Computer’s partnership with the LangChain team and use of LangSmith will remain pivotal to how the team uses novel AI materials to simulate the complexities of a deepening relationship with human users.

원문 보기 https://www.langchain.com/blog/customers-new-computer