示例按依赖复杂度分为三组,建议按顺序探索。
依赖标记说明:
| 标记 | 含义 |
|---|---|
零依赖 |
仅需项目本身,无需外部服务 |
需 LLM API |
需要配置 LLM API 密钥(如 OpenAI) |
需 OceanBase |
需要 OceanBase >= 4.2.2 或 seekdb |
需可选依赖 |
需要安装可选依赖(如 langchain、powermem) |
basic/ — 入门示例
依赖最小,适合初次了解 ContextSeek。
| 文件 | 依赖 | 说明 |
|---|---|---|
pipeline_file.py |
零依赖 |
本地文件后端,关键词检索 |
pipeline_ob.py |
需 OceanBase |
向量 + 全文混合检索 |
langchain.py |
需可选依赖 |
LangChain Memory / Retriever 桥接 |
langchain_deepagents_example.py |
需 LLM API |
LangChain + DeepAgents + ContextSeek 的真实集成示例 |
uv run python examples/basic/pipeline_file.py # 零外部依赖,推荐首选advanced/ — 完整能力展示
涵盖 LLM 集成、演进流水线、DataPlug 扩展。
| 文件 | 依赖 | 说明 |
|---|---|---|
research_agent.py |
零依赖 |
所有核心功能综合演示(推荐) |
evidence_chain.py |
零依赖 |
证据链溯源:upstream / evidence_chain / chain_confidence |
self_evolution_demo.py |
零依赖 |
自演进四项特性:冲突检测、双时态、utility 反馈、pitfall 反思 |
llm_full_pipeline_ob.py |
需 OceanBase + 需 LLM API |
Phase 1/2/3 完整 LLM 流水线 |
powermem_minimal.py |
零依赖 |
PowerMem 最小集成路径(~50 行) |
powermem_plug.py |
需可选依赖 |
PowerMem DataPlug 完整演示 |
uv run python examples/advanced/research_agent.py # 推荐:零外部依赖的完整演示gis/ — 地理空间场景
需要 OceanBase >= 4.2.2(或 seekdb)且 GEO_ENABLED=true。
| 文件 | 依赖 | 场景 |
|---|---|---|
poi_search.py |
需 OceanBase |
地图 POI 关键词 + 地理混合搜索 |
ride_hailing.py |
需 OceanBase |
打车调度:司机 / 订单 / 热力区域 |
autonomous_driving.py |
需 OceanBase |
智能驾驶:HD 地图 / ODD / 道路事件 |
gis_memory.py |
需 OceanBase |
GPS 轨迹 → 地点事实 → 行为知识 |
smart_swap.py |
需 OceanBase |
GIS 记忆驱动的分层换电推荐 |
GEO_ENABLED=true uv run python examples/gis/poi_search.py启动 API 服务:
uvicorn contextseek.http.server:app --host 127.0.0.1 --port 8000 --reload示例请求:
curl -X POST http://127.0.0.1:8000/add \
-H "Content-Type: application/json" \
-d '{"content": "hello", "scope": "t/p/u", "source": "curl"}'
curl -X POST http://127.0.0.1:8000/retrieve \
-H "Content-Type: application/json" \
-d '{"query": "hello", "scope": "t/p/u", "k": 5}'端点:/add、/retrieve、/expand、/compact、/forget、/delete、/health