Context Engineering
Overview 构建agent的难点在于使他们足够可靠 即时他们在原型阶段往往会表现得很好 Why do agent fails LLM调用采取了错误的措施或者没有按照预期执行,原因: LLM能力不够 正确的context没有传递给LLM 更多情况是后者 ...
Overview 构建agent的难点在于使他们足够可靠 即时他们在原型阶段往往会表现得很好 Why do agent fails LLM调用采取了错误的措施或者没有按照预期执行,原因: LLM能力不够 正确的context没有传递给LLM 更多情况是后者 ...
GuardRails通过validating和flitering content来帮助你构建安全合规的agent 常见的应用场景: 预防个人信息的泄露 检测和阻止提示词注入攻击 阻止不恰当和有害的攻击 执行业务规则和合规性要求 验证输出重量和正确性 你可以在使用middleware在关键节点拦截执行 before the agent starts, after it completes, or around model and tool calls. ...
By checking each tool call against a configurable policy 如果需要暂停,middleware将会issue an interrupt来暂停执行 图状态将会使用LangGraph的persistence layer来保存,因此可以pause and resume later ...
Across sessions and conversations Long-term memory 建立在Lang Graph stores,存储的形式:JSON documents organized by namespace and key Usage 为了给一个agent添加memory功能,在使用create_agent时create a store and pass it to agent ...
Two limitations of LLM: finite context Static Knowledge RAG(检索增强生成) Building a knowledge base A repository of documents of structured data 使用LangChain’s document loaders and vector stores 来建立你自己的知识库 如果你已经有知识库,你不需要重建,你只需要 ...
LangChain’s create_agent的底层运行在LangGraph’s runtime LangGraph暴露一个Runtime object,提供以下的信息: 1.context:静态信息:user id,数据库连接和其他的依赖 2.Store:用于长期记忆的BaseStore实例 3.Stream writer:通过"custom"流式传输模式来硫化信息的object 4.Execution info: identity and retry information for the current execution(thread ID, run ID ,attmpt number) 5.Server info:在 LangGraph Server 上运行时的特定于服务器的元数据(assistant ID,graph ID, authenticated user ) You can access the runtime information within tools and middleware ...