memcode README

项目的 README,来自 github.com/memcode-in/memcode。合并为一个 markdown 文件:README.md。

mypy logo

Mypy: Static Typing for Python

Stable Version Downloads Build Status Documentation Status Chat at https://gitter.im/python/typing Checked with mypy Code style: black Linting: Ruff

Got a question?

We are always happy to answer questions! Here are some good places to ask them:

If you're just getting started, the documentation and type hints cheat sheet can also help answer questions.

If you think you've found a bug:

To report a bug or request an enhancement:

To discuss a new type system feature:

What is mypy?

Mypy is a static type checker for Python.

Type checkers help ensure that you're using variables and functions in your code correctly. With mypy, add type hints (PEP 484) to your Python programs, and mypy will warn you when you use those types incorrectly.

Python is a dynamic language, so usually you'll only see errors in your code when you attempt to run it. Mypy is a static checker, so it finds bugs in your programs without even running them!

Here is a small example to whet your appetite:

number = input("What is your favourite number?")
print("It is", number + 1)  # error: Unsupported operand types for + ("str" and "int")

Adding type hints for mypy does not interfere with the way your program would otherwise run. Think of type hints as similar to comments! You can always use the Python interpreter to run your code, even if mypy reports errors.

Mypy is designed with gradual typing in mind. This means you can add type hints to your code base slowly and that you can always fall back to dynamic typing when static typing is not convenient.

Mypy has a powerful and easy-to-use type system, supporting features such as type inference, generics, callable types, tuple types, union types, structural subtyping and more. Using mypy will make your programs easier to understand, debug, and maintain.

See the documentation for more examples and information.

In particular, see:

Quick start

Mypy can be installed using pip:

python3 -m pip install -U mypy

If you want to run the latest version of the code, you can install from the repo directly:

python3 -m pip install -U git+https://github.com/python/mypy.git

Now you can type-check the statically typed parts of a program like this:

mypy PROGRAM

You can always use the Python interpreter to run your statically typed programs, even if mypy reports type errors:

python3 PROGRAM

If you are working with large code bases, you can run mypy in daemon mode, that will give much faster (often sub-second) incremental updates:

memcode run -- PROGRAM

You can also try mypy in an online playground (developed by Yusuke Miyazaki).

Integrations

Mypy can be integrated into popular IDEs:

Web site and documentation

Additional information is available at the web site:

https://www.mypy-lang.org/

Jump straight to the documentation:

https://mypy.readthedocs.io/

Follow along our changelog at:

https://mypy-lang.blogspot.com/

Contributing

Help in testing, development, documentation and other tasks is highly appreciated and useful to the project. There are tasks for contributors of all experience levels.

To get started with developing mypy, see CONTRIBUTING.md.

Mypyc and compiled version of mypy

Mypyc uses Python type hints to compile Python modules to faster C extensions. Mypy is itself compiled using mypyc: this makes mypy approximately 4 times faster than if interpreted!

To install an interpreted mypy instead, use:

python3 -m pip install --no-binary mypy -U mypy

To use a compiled version of a development version of mypy, directly install a binary from https://github.com/mypyc/mypy_mypyc-wheels/releases/latest.

To contribute to the mypyc project, check out the issue tracker at https://github.com/mypyc/mypyc

memcode (memcode-in/memcode)

正在搜索数据库…

这是干什么的?MemCode 是面向 AI 的记忆基础设施:它为智能体、AI 编程助手、应用和工作流提供持久记忆,即使换了会话、超出上下文窗口、甚至换了模型,记忆也不会丢失。
这是我要导入的库,还是一个托管平台?它是一个记忆基础设施层,自带一个仪表盘应用(app.memcode.in),其他智能体、AI 编程助手和应用都连接到它来存取记忆,而不是一个简单的进程内库。
怎么在本地把仪表盘跑起来?克隆仓库,用 npm 安装依赖,复制自带的环境变量模板并填入你自己的值,然后启动开发服务器;生产构建会先做 TypeScript 校验,再用 Vite 打包。
除了 Node.js 和 npm,我还需要准备什么吗?前置条件只需要 Node.js 和 npm,另外要在本地配置好你自己的环境变量——生产环境的凭据或私钥千万不要提交到仓库里。
现在就能直接用到生产环境吗?不行,MemCode 还在积极开发中,随着团队不断改进检索质量、记忆评估、集成和开发者体验,它的 API、接口和底层设施都可能变动。
它存下的记忆,由谁来控制访问权限?MemCode 的设计是通过明确的访问控制和保留策略来管理记忆,而不是让存进去的记忆无限期地开放下去。
与其用这个,为什么不直接加大上下文窗口?更大的提示词只能扩展单次会话能看到的内容;而 MemCode 的记忆能跨会话、跨上下文窗口、甚至跨模型保留,所以智能体在对话结束很久之后仍然记得之前的决定和偏好。
对 MemCode 来说,“选择性”记忆是什么意思?系统不是把所有东西都记录下来,而是设计成自行判断什么值得记住,这样检索就能聚焦在重要的决定和学到的新知识上,而不是一堆噪音。
存进去的记忆怎么取出来?既可以通过语义检索(按意思搜索)查询记忆,也可以通过结构化检索(按字段搜索)查询,而且系统运维人员应该能够直接查看这些记忆。
MemCode 是开源的吗?是的,仓库以 MIT 许可证发布,不过目前使用它的主要方式还是 app.memcode.in 上的托管仪表盘。
大小
4.3 MB
星标
592
更新
提交Oct 28
时长
3个月
提交 · 90 天