diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1b93424 --- /dev/null +++ b/.env.example @@ -0,0 +1,34 @@ +# Copy this file to .env and fill in only the provider you use. + +# Provider selection: iflow or mimo +LLM_PROVIDER=iflow + +# iFlow / OpenAI-compatible API +IFLOW_API_KEY= +IFLOW_BASE_URL=https://apis.iflow.cn/v1 +DEFAULT_MODEL=qwen3-max +CODER_MODEL=qwen3-coder-plus +REASONING_MODEL=deepseek-r1 +VISION_MODEL=qwen-vl-max +IFLOW_TIMEOUT_SEC=90 +IFLOW_GENERAL_TIMEOUT_SEC=90 +IFLOW_CODER_TIMEOUT_SEC=180 +IFLOW_THINKER_TIMEOUT_SEC=240 +IFLOW_VISION_TIMEOUT_SEC=120 + +# Xiaomi MiMo / OpenAI-compatible API +MIMO_API_KEY= +MIMO_BASE_URL=https://api.xiaomimimo.com/v1 +MIMO_MODEL=mimo-v2-pro +MIMO_TIMEOUT_SEC=90 + +# Optional search integration +TAVILY_API_KEY= + +# Optional Neo4j integration used by some capabilities +NEO4J_URI=bolt://localhost:7687 +NEO4J_USER=neo4j +NEO4J_PASSWORD= + +# Local semantic-memory model +MEMORY_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 diff --git a/.github/workflows/repository-smoke.yml b/.github/workflows/repository-smoke.yml new file mode 100644 index 0000000..3773f2e --- /dev/null +++ b/.github/workflows/repository-smoke.yml @@ -0,0 +1,54 @@ +name: Repository Smoke Checks + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + repository-contract: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Validate required project files + run: | + python - <<'PY' + from pathlib import Path + + required = [ + Path("README.md"), + Path("LICENSE"), + Path("requirements.txt"), + Path(".env.example"), + Path("openclaw_continuity.py"), + Path("iflow_adapter.py"), + Path("mimo_adapter.py"), + ] + missing = [str(path) for path in required if not path.is_file()] + if missing: + raise SystemExit("Missing required project files: " + ", ".join(missing)) + + requirements = { + line.strip() + for line in Path("requirements.txt").read_text(encoding="utf-8").splitlines() + if line.strip() and not line.lstrip().startswith("#") + } + if "sqlite3" in requirements: + raise SystemExit("sqlite3 is part of Python's standard library and must not be a pip requirement") + PY + + - name: Compile root runtime files + run: | + python -m py_compile \ + openclaw_continuity.py \ + iflow_adapter.py \ + mimo_adapter.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3538dcc --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 zhufeng + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c112e70 --- /dev/null +++ b/README.md @@ -0,0 +1,91 @@ +# My AI Body / OpenClaw + +An experimental autonomous-agent runtime that explores continuity, persistent memory, self-modeling, dynamic capabilities, skills, daemons, patches, and workspace-level evolution. + +> This repository is a research system, not a production-safe autonomous runtime. Generated or dynamically loaded code can perform local actions. Run it only in an isolated environment with credentials and filesystem access scoped to the minimum required. + +## Current runtime entrypoint + +The current root runtime is: + +```bash +python openclaw_continuity.py +``` + +`openclaw_continuity.py` contains the continuity kernel and coordinates the persistent memory, emotional state, evolution metrics, tool discovery, capabilities, skills, daemons, patches, and the main agent loop. + +## Repository layout + +- `openclaw_continuity.py` — continuity kernel and current executable entrypoint +- `iflow_adapter.py` — iFlow/OpenAI-compatible model adapter +- `mimo_adapter.py` — Xiaomi MiMo/OpenAI-compatible model adapter +- `workspace/capabilities/` — runtime capabilities and capability implementations +- `workspace/skills/` — generated or curated skills +- `workspace/tools/` — callable tools and diagnostics +- `workspace/daemons/` — background runtime components +- `workspace/patches/` — runtime patch experiments +- `workspace/rules/` — generated or curated runtime rules +- `workspace/docs/` — architecture and generation-rule documentation +- `PLAN/` and `AAA/` — research notes and experimental artifacts; these are not part of the minimal runtime contract + +## Quick start + +Python 3.10 or newer is recommended. + +```bash +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +cp .env.example .env +``` + +Fill in at least one provider configuration in `.env`, then run: + +```bash +python openclaw_continuity.py +``` + +On Windows PowerShell, activate the virtual environment with: + +```powershell +.\.venv\Scripts\Activate.ps1 +``` + +## Model providers + +Select the provider with: + +```env +LLM_PROVIDER=iflow +``` + +Supported root adapters currently include: + +- `iflow` through `IFLOW_API_KEY` and `IFLOW_BASE_URL` +- `mimo` through `MIMO_API_KEY` and `MIMO_BASE_URL` + +Model names and request timeouts can be overridden in `.env`; see `.env.example`. + +## Persistence + +The continuity runtime stores local state under `workspace/`, including SQLite memory and evolution state. Database files, logs, generated media, and common validation outputs are excluded by `.gitignore` and should not be treated as source code. + +Before switching branches or replacing a runtime, back up any local memory database that you intend to preserve. + +## Dependencies + +`requirements.txt` contains the core runtime dependencies. Individual generated capabilities may require additional packages such as media, OCR, browser, or platform-specific libraries. Those optional dependencies should be documented alongside the capability that uses them rather than silently added to the core runtime. + +## Validation + +The repository smoke workflow checks: + +- required project-contract files exist +- root runtime files are valid Python syntax +- no external API call is required during the check + +A passing smoke check does not prove autonomous behavior, model connectivity, memory correctness, or safety. Those require focused tests and controlled integration environments. + +## License + +MIT. See `LICENSE`. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..22def8d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,19 @@ +# Core runtime +python-dotenv +pydantic +langchain-core +langchain-openai +langgraph + +# Memory and data processing +sentence-transformers +numpy +pandas +pytz +python-dateutil +tzdata + +# Integrations used by existing capabilities +langchain-community +langchain-tavily +neo4j