🌐 فراتر از مرزها؛ مسیر بین‌المللی CardDev

Understanding agent memory and knowledge

Chapters
16 Flashcards
21 Gallery cards
53 Audio
16 Prompts
16 Glossary

Imagine you have deployed your assistant for a pharmaceutical company's support, and a doctor asks: "What are the side effects of your new drug?" However much the language model has read, nothing about this drug is in its knowledge, so it either admits it does not know or guesses. The third way is to hand it the company's documents. That is retrieval. 📖 RAG at a glance | Step | Action | |---|---| | 1️⃣ | Load documents and chunk them into small pieces | | 2️⃣ | Convert chunks into embedding vectors | | 3️⃣ | Store them in a vector database | | 4️⃣ | Turn the query into a vector and find the most similar chunks | | 5️⃣ | Add the chunks to the prompt so the model answers from the document | 💡 Similarity is measured with cosine similarity: the smaller the angle between two vectors, the closer the meaning. 🧠 Knowledge and memory 📚 Knowledge: your document store; chunk size and overlap decide accuracy 💬 Memory: the same mechanism but dynamic; sensory, short-term and long-term 🧩 Semantic, episodic and procedural memory for storing concepts, events and task steps 🗜️ Compression with clustering so memory does not get cluttered and slow 🔗 Tooling LangChain turns this whole pipeline into simple steps, and Nexus provides an interface to manage knowledge and memory stores. 🧭 Decisions that make accuracy Two simple numbers decide the quality of the whole system: chunk size and overlap. A big chunk brings irrelevant information into the prompt; a small one drops the context. For legal contracts a smaller chunk catches a clause precisely, and for code documentation more overlap keeps logic from being cut. 🧹 Memory needs upkeep too A memory that only fills up ends up slow and inaccurate. Clustering and summarizing keep it light and relevant, and the compression interface shows which cluster has grown too large.

Chapter

1

Cover of AI Agents in Action
Manning Publications

Chapter 8 of AI Agents in Action: Understanding agent memory and knowledge

Book release

Published

Chapter 8 progress
Book progress

Reading time

00:46

Gallery

Yes

Audio status

Preview

Analysis

AI