Skip to main content

Semantic Seed Expander - 知智感知层的意图发散器

Project description

KnowAI SSE

Python License Tests

语义种子扩展引擎 (Semantic Seed Expander) - 知智感知层的意图发散器。利用 LLM 的语义理解能力,根据预设的价值观对核心主题进行采样与漂移,生成一组具有高知识密度的搜索指令。

功能特性

  • 价值观驱动的意图发散:根据星球价值观生成个性化的搜索指令
  • 多渠道支持:支持 arXiv、Web、RSS 等多种搜索渠道
  • 异步设计:完全异步实现,支持高并发场景
  • 类型安全:基于 Pydantic 的严格类型校验
  • 可扩展性:插件化设计,易于添加新的价值观和搜索渠道

安装

pip install knowai-sse

或从源码安装:

git clone https://github.com/your-org/knowai-sse.git
cd knowai-sse
pip install -e .

快速开始

import asyncio
from knowai_sse import Expander
from knowai_sse.models import PlanetContext

async def main():
    expander = Expander(
        api_key="your-deepseek-api-key",
        base_url="https://api.deepseek.com"
    )

    context = PlanetContext(
        theme="具身智能",
        values_map={"radical": 0.8, "ethics": 0.2}
    )

    result = await expander.expand(context)
    for instruction in result.instructions:
        print(f"[{instruction.channel}] {instruction.query}")

    await expander.close()

asyncio.run(main())

核心概念

价值观

系统支持以下价值观维度:

  • radical:侧重前沿实验室、GitHub 趋势、未发表论文
  • ethics:关注 AI 伦理、数字鸿沟、技术公平性
  • practical:关注工程实践、应用案例、落地效果
  • academic:侧重理论基础、学术严谨性、同行评审
  • open_source:关注开源项目、社区生态、开发者工具

搜索渠道

  • arxiv:学术文献搜索,支持 LaTeX 语法
  • web:网页搜索,支持 Google Search Operators
  • rss:RSS 订阅源搜索

项目结构

knowai-sse/
├── src/
│   └── knowai_sse/
│       ├── core/
│       │   ├── expander.py      # 核心逻辑控制器
│       │   └── prompt_mgr.py    # 提示词管理器
│       ├── models/
│       │   └── schema.py        # 数据契约
│       ├── adapters/
│       │   └── llm_client.py    # LLM 适配器
│       └── exceptions.py        # 异常定义
├── tests/
├── examples/
└── docs/

开发

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest tests/ -v

# 运行集成测试(需要设置 DEEPSEEK_API_KEY)
cp tests/.env.example tests/.env
pytest tests/ -v -m "integration"

# 代码格式化
black src/ tests/
ruff check src/ tests/

# 类型检查
mypy src/

文档

详细文档请访问:https://tobegold574.github.io/knowai-sse/

贡献

欢迎贡献!请查看 CONTRIBUTING.md 了解详情。

许可证

MIT License - 详见 LICENSE 文件。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knowai_sse-0.0.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knowai_sse-0.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file knowai_sse-0.0.1.tar.gz.

File metadata

  • Download URL: knowai_sse-0.0.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for knowai_sse-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e2c486fb97e6a4dbc77029804d395b08b9f7447ff44b28688cc64c7697e6ce2f
MD5 0d05e560e5285ec51d43a455dd61c53f
BLAKE2b-256 5a5e986982c36093646d24bf4da8a3e491cbc33fe2a6da3b3777aede3a26cf55

See more details on using hashes here.

File details

Details for the file knowai_sse-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: knowai_sse-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for knowai_sse-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ea2c4f3ce7d68e557276af74e6c1f0c3e99c0ada2565ee8ad3c34c1e0eda4e9
MD5 7db2919723de80062fd0d957eca84e9c
BLAKE2b-256 0f317329c4a17bfe033d6702ca6ea1f921d6d2b6fbd14f00085ddaba8f99936b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page