<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DeepAgent &#8211; 天地一沙鸥</title>
	<atom:link href="https://haoluobo.com/tag/deepagent/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com</link>
	<description>to be continue....</description>
	<lastBuildDate>Tue, 24 Mar 2026 02:43:02 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>用AI写小说的尝试</title>
		<link>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/</link>
					<comments>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/#respond</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Tue, 24 Mar 2026 02:31:53 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[DeepAgent]]></category>
		<category><![CDATA[LangChain]]></category>
		<category><![CDATA[小说]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12937</guid>

					<description><![CDATA[前情提要《我的 AI Agent 实验项目 Sequoia》 小说完成情况 小说创作系统搭建 遇到的问题以及解 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>前情提要<a href="https://haoluobo.com/2026/03/ai-agent-sequoia/" target="_blank" rel="noreferrer noopener">《</a><a href="https://haoluobo.com/wp-admin/post.php?post=12857&amp;action=edit">我的 AI Agent 实验项目 Sequoia</a>》</p>



<h2 class="wp-block-heading">小说完成情况</h2>



<ol class="wp-block-list">
<li>已完成 10 万字左右，总共24章。</li>



<li>小说名字： <a href="https://fanqienovel.com/page/7618116230070684697" target="_blank" rel="noreferrer noopener">《他们都劝我冷静，然后我疯了》</a> 发布在番茄小说。通过 <code>签约认证</code> ，未通过 <code>作品推荐</code> 审核。</li>



<li>由于让 AI 写小说的主要目的是验证 AI 能力，近期应当不会继续更新。</li>
</ol>



<h2 class="wp-block-heading">小说创作系统搭建</h2>



<ol class="wp-block-list">
<li>使用 <a href="https://www.langchain.com/deep-agents" target="_blank" rel="noreferrer noopener">LangChain Deep Agents</a> 作为 Agent 开发框架。</li>



<li>小说创作知识通过 SKILL 提供。</li>



<li>通过 <a href="https://docs.langchain.com/oss/python/langchain/tools" target="_blank" rel="noreferrer noopener">tools</a> 为平台提供图数据库读写等额外的能力（未实际使用）。</li>
</ol>



<h2 class="wp-block-heading">遇到的问题以及解决方案</h2>



<p>根据我的最初预想，小说的摘要及人物小传等知识使用层次化的 Markdown 来存储，方便人工审阅。人物关系等信息通过图数据库存储，并通过向量数据库提供前期剧情的搜索。实际使用过程中发现，图数据库和向量数据库的使用必须给定详细的规范，如果只提供基础的读写接口，AI 无法很好的利用数据库能力来辅助写作，引入的问题远高于解决的问题。此外良好的 Markdown 结构设计已足以支持小说写作。</p>



<p>当使用一个工具时，该工具的所有知识需要加入到对话的上下文中。如果 Agent 用到的工具很多，且这些工具都有详细的使用知识，则会占用很多宝贵的上下窗口。为了解决该问题可以将这个工具作为独立的 SubAgent，将工具使用的详细说明放到 SubAgent 中。</p>



<p>Deep Agents 默认提供了文件读写工具，通常情况使用该工具实现文件读写即可。但在明确要求加载 <code>outline</code> 目录内设有知识的情况下依旧会根据自己的判断只加载部分文件。似乎在上下文过长时 AI 的遵从性会下降（注： AI 所使用的 Transformer 本就是 <code>注意力机制</code> ，AI 和人一样，内容多了就容易丢失重点）。</p>



<p>为了保证摘要的完整加载，同时文件分别加载所带来的 AI 多次决策问题，需要提供一个一次性加载所有摘要知识的接口。尝试在 SKILL 里增加加载摘要的脚本。可能是出于安全等问题的考量， Deep Agents 在执行脚本前会对脚本做非常多的检查，即使在 SKILL 里明确要求直接执行也无法避免。最终将该脚本封装成 LangChain 的工具。</p>



<p>阿里百练平台为每个模型提供了 100 万免费 token。使用过程中发现只进行了几轮对话一百万 token 就会耗尽。后切换到 DeepSeek。DeepSeek 应当是主流 API 里最便宜的了，如果缓存命中，每百万的输入0.2元。对于小说写作任务，有着大量的缓存命中。随着章节的增加，写一章小说的 Token 消耗会持续增加。写到20章时，写一遍，再审阅一遍，一章花费1～2元。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2026/03/an-attempt-to-write-a-novel-using-ai/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
