Building Persistent AI Memory for API Specifications Using Cognee and Fern
说明与用途
使用 Cognee 和 Fern 构建了 API 规范的持久知识图,支持 AI 代理进行多跳推理。
问题
Standard vector retrieval (RAG) treats API endpoint schemas as plain text, fragmenting path parameters from query parameters, request bodies from response types, and error definitions from endpoint paths, preventing AI agents from accessing structured API knowledge.
结果
The Fern connector enabled AI agents to persistently remember and reason over entire API ecosystems, providing structured, multi-hop architectural memory.
工作流
- 1. Install cognee-community-connector-fern and cognee via pip.
- 2. Point fern_source to the Fern workspace directory.
- 3. Ingest API definitions and guides with cognee.add().
- 4. Cognify the ingested data into a knowledge graph with cognee.cognify().
- 5. Query the graph using cognee.search() with INSIGHTS query type.
证据
Standard vector retrieval (RAG) fails. It treats endpoint schemas as plain text, fragmenting path parameters from query parameters, request bodies from response types, and error definitions from endpoint paths.
We built the official Fern API Documentation Connector for Cognee.
pip install cognee-community-connector-fern cognee
await cognee.search(query_type="INSIGHTS", query_text="What endpoints handle user authentication and what error types can they throw?")
- 记录日期: 2026-10-24T21:11:26.988Z