Skip to main content

灵机一动 (lingjiyidong)

灵光乍现,代码自成。一个从零手写的 AI 代码 Agent,不依赖 LangChain 等框架。

安装

pip install lingjiyidong

使用

需要先设置 Anthropic API Key:

export ANTHROPIC_API_KEY=your_key

然后直接启动:

lj

功能

  • 对话模式:直接与 Agent 对话,支持多轮上下文
  • 任务规划模式:输入 /plan <目标>,Agent 自动拆解任务并逐步执行
  • 工具调用:读写文件、执行命令、搜索代码、抓取网页等
  • 长期记忆:自动保存重要信息,下次启动时加载
  • 上下文压缩:长对话自动压缩,不会撑爆 context window

内置工具

工具 说明
read_file 读取文件内容
write_file 创建或覆盖写入文件
edit_file 精准替换文件中的一段内容
create_directory 创建目录
list_files 列举目录文件
grep_files 全文搜索代码和文本
bash 执行 shell 命令
web_search 网络搜索(需配置 TAVILY_API_KEY
web_fetch 抓取网页内容
save_memory 保存信息到长期记忆

技术栈

  • Python 3.11+
  • Claude API(Anthropic SDK)
  • 无框架,手写核心循环

Download files

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

Source Distribution

lingjiyidong-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

lingjiyidong-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file lingjiyidong-0.1.0.tar.gz.

File metadata

  • Download URL: lingjiyidong-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for lingjiyidong-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39a00788ebe8873ffacef26d931a3f7676ac69d5fec772d74135add0c75feaf3
MD5 ef7c2c68436a6372d346b12884ed9c76
BLAKE2b-256 ae35d1336f25ad8314ac8d6cb30b998e6876b91ba0ea1ed212e90e66a3f99cf8

See more details on using hashes here.

File details

Details for the file lingjiyidong-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lingjiyidong-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for lingjiyidong-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc8807a89b30198dc3eae8729a5bdeb62f211bf598522cd698e63419079a9a17
MD5 9489407f8277d4507b230f1ee45fe959
BLAKE2b-256 10d04328c1631450a60ffb5ec8fa09aeceb3d7c41eea85a3241c967c12d73df6

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