Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Biomimetic autonomous cognitive AI brain — never forgets, self-learning, hallucination-resistant, desktop-controllable
Fetched from the repository for this visit.
A self-learning, hallucination-resistant AI cognitive engine that never forgets — fully self-hosted on CPU.
知境不是模型,是套在模型外面的一层:一个自托管(CPU 即可)的认知引擎,接任意 LLM, 负责记住、自己学、自己查错这三件模型本身不负责的事。
实际运行形态(2026-11 生产实测,不是设计图)
| 进程 | 端口 | 职责 |
|---|---|---|
aelvoxim-api | 9701 | FastAPI 服务:对话、检索、系统与管理接口 |
aelvoxim-chatael | 9702 | 前端页面 + 会话存储 |
aelvoxim-learner | 无端口 | 学习循环 + 皮层调度器(独立进程,心跳写 learner/status.json) |
| PostgreSQL | 5432 | 知识、会话、方向、记忆实体(本机 127.0.0.1) |
| nginx | 80/443 | TLS 终止 + 反代(公网只开这两个口) |
能拿数据背书的几件事(数字均取自代码现读)
依赖与质量现状
>=2026.10.19)src/ 44,609 行 Python;scripts/dep_drift.py 可随时核对"声明 vs 实装"还没做实的地方(写在文档里,而不是留给读者猜)
L5 是限流、L6 是熔断,
都在 core/metacog_monitor.py;L1–L4 没有对应实现。伦理部分实际是 experts/ethics.py 的规则 + 投票。learn/llm.py 里对 core.safety.r6_intercept_output 的调用是空挂(模块不存在,被
except Exception: pass 吞掉)——2026-11-04 已删除该调用,不再假装有这层防护;
输出侧实际生效的是 content_filter(需 AELVOXIM_CONTENT_FILTER=1)。core/judge.py 里 JudgeEngine / RuleBasedJudge / Proposal 三件套齐全,
dgmh.check_gate 也按 judge_grade 分档(update 需 A),但 src 内无人实例化它们,
也没有任何代码写 judge_grade(2026-10-19 661d5d3 删掉"默认冒充 B"之后,
提案一律落到 ungraded 队列)。实际可用的是人工入口 scripts/dgmh_review.py;
按结果自动判分尚未实现——纯规则打分(RuleBasedJudge)只能当过滤器,不能当放行者。| 你的痛点 | 常见做法 | 知境的做法 |
|---|---|---|
| 换个会话就忘 | 每个 chat 独立,无持久记忆 | 4 层记忆 + 实体/关系图,会话与会话之间共享 |
| 用久了也不变强 | 没有后台学习机制 | 7×24 学习循环:间隔重复 + 好奇选题 + 参数自校准 |
| 说错了自己不知道 | 没有运行时自检 | 10 信号元认知触发 → 自校准 / 熔断 |
| 安全是事后补的 | 外挂护栏,容易绕过 | 内容过滤 + 伦理专家投票 + L5 限流 + L6 熔断 |
| 换模型等于重来 | 绑死一家 | 框架级抽象:DeepSeek / OpenAI / Ollama / Anthropic 可换 |
┌──────────────────────────┐
public :443/:80 ─┤ nginx (TLS, 反代) │
└────────────┬─────────────┘
│
┌─────────────────────────┼──────────────────────────┐
│ │ │
┌───────▼────────┐ ┌─────────▼─────────┐ ┌─────────▼──────────┐
│ aelvoxim-api │ │ aelvoxim-chatael │ │ aelvoxim-learner │
│ 9701 FastAPI │ │ 9702 前端/会话 │ │ 无端口 · 学习循环 │
│ 对话/检索/管理 │ │ │ │ + 皮层调度器 │
└───────┬────────┘ └─────────┬─────────┘ └─────────┬──────────┘
│ │ │
└─────────────────────────┼──────────────────────────┘
│
┌────────────▼─────────────┐
│ PostgreSQL 127.0.0.1:5432 │
│ knowledge_entries / chat_ │
│ sessions / learning_dirs │
└───────────────────────────┘
认知层:core/(元认知 10 信号 · 信念 · 裁决 · 校准)
学习层:learn/(循环 · 分解 · 执行 · 验证 L1–L3 · 复习 · topic 闸)
专家层:experts/(6 加权投票 + introspection meta + code-review)
这里不评价别家产品。我们拿不出对别人内部实现的证据,所以只写自己这一列 —— 每一项都挂一条可复算的凭据。
| 能力 | 实现位置 | 怎么自证 |
|---|---|---|
| 4 层记忆 | memory/__init__.py | working 24h TTL / episodic 7d / semantic 长期 / procedural 在 access_count>=5 自动升级 |
| 10 个元认知信号 | core/metacog.py FALLBACK_WEIGHTS | 打印该字典得 10 个键:success_rate、stagnation、repeat_failure、external_signal、introspection、memory_health、snapshot_trend、belief_health、execution_health、retrieval_gap |
| 6 个加权投票专家 | experts/orchestrator.py EXPERT_WEIGHTS | memory/logic/ethics/safety/creative/emotion,权重合计 1.00;introspection 作 meta 层;code-review 供路由调用 |
| 3 层知识验证 | learn/validator.py | L1 多引擎检索(3 引擎过 2)→ L2 LLM 正反辩论 → L3 聚合分数 |
| 后台学习循环 | learn/loop.py + aelvoxim-learner 进程 | learner/status.json 的 loop_count / updated_at 持续前进 |
| 知识准入闸 | learn/topic_gate.py + learn/knowledge.py | 写库前过闸,拒收计数出现在 status.json 的 kb_topic_gate |
| 依赖可复现 | requirements.txt + scripts/dep_drift.py | dep_drift.py 退出码 0 = 声明与实装一致 |
| 运维读数 | scripts/readout.py | 六项体检(服务 / 知识闸 / 队列 / 空回复率 / 心跳 / 依赖漂移)一条命令出结论 |
什么时候别用它(这些边界比对比表更有用)
一句话说清和 LLM 的关系:它不替代模型,是外挂的认知层 —— 换模型,记忆、元认知、学习闭环都还在。
Every conversation updates an evolving memory system. Start a new session — the AI picks up exactly where you left off.
core/belief.py) tracks knowledge certainty via Beta distributionThe system doesn't just answer questions — it proactively learns in the background.
The system watches itself. It's not just "reflection" — it's systematic self-monitoring.
core/selfmodel.py) — Beta-distribution capability scoring across 5+ dimensions with trend analysisEvery decision is voted on by specialized expert modules with dynamic weighting:
| Expert | Weight | Role |
|---|---|---|
| Memory | 0.20 | Factual consistency, knowledge retrieval |
| Logic | 0.20 | Reasoning quality, contradiction detection |
| Ethics | 0.15 | 15 safety rules (privacy, violence, fraud, child protection...) |
| Safety | 0.20 | Prompt injection guard, SentriKit integration |
| Creative | 0.15 | Alternative perspectives, lateral thinking |
| Emotion | 0.10 | Sentiment tracking, empathy mode |
| Introspection | meta | S/A/B/C/D grade, issue detection and reporting |
Confidence gap > 0.3 or ethics block → LLM arbitration with weighted-vote fallback.
See SECURITY.md for the full security policy.
Quick security checklist for users:
| Concern | Status |
|---|---|
| Prompt injection guard | ✅ Built-in, enabled via AELVOXIM_CONTENT_FILTER=1 |
| API Key authentication | ✅ Required for all endpoints |
| Rate limiting | ✅ Built into MetaCogMonitor (L5) |
| Ethics gates (L1–L6) | ⚠️ 文档旧称与代码不符:L5=限流、L6=熔断(core/metacog_monitor.py),L1–L4 无对应实现;伦理实际由 experts/ethics.py 规则 + 投票承担 |
| Circuit breaker | ✅ 3 consecutive low-confidence → auto trip |
| Data encryption at rest | ⚠️ JSON file storage — encrypt at filesystem level |
| PostgreSQL connection | ✅ Uses password auth, localhost-only by default |
| Check | Service | When |
|---|---|---|
| Lint (Ruff) | GitHub Actions | Every push/PR |
| Tests (3 Python versions) | GitHub Actions | Every push/PR |
| Security scan | GitHub Actions + CodeQL | Every push/PR + weekly |
| Dependency updates | Dependabot | Weekly (security only) |
All CI workflows are in .github/workflows/.
PR template is at .github/PULL_REQUEST_TEMPLATE.md.
See CONTRIBUTING.md for detailed guidelines.
Quick rules:
pytest tests/ -v before submitting| Port | Service | Description |
|---|---|---|
| 9701 | API Server (FastAPI) | Core brain — chat, auth, admin, knowledge, learning |
| 9702 | Frontend (ChatAEL-v2) | Web chat interface (compiled SPA) |
| 5432 | PostgreSQL | Sessions, messages, knowledge base, users |
git clone https://github.com/macor24/aelvoxim.git
cd aelvoxim
# Python dependencies
pip install -e .
# Configure PostgreSQL (optional, skip if using JSON storage)
psql -U postgres -c "CREATE DATABASE aelvoxim;"
psql -U postgres -c "CREATE USER aelvoxim WITH PASSWORD 'your_password';"
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE aelvoxim TO aelvoxim;"
export AELVOXIM_DATABASE_URL="host=localhost port=5432 dbname=aelvoxim user=aelvoxim password=your_password"
Set one of these environment variables (see docs for full list):
# DeepSeek
export DEEPSEEK_API_KEY="sk-..."
export LLM_PROVIDER="deepseek"
# OpenAI
export OPENAI_API_KEY="sk-..."
export LLM_PROVIDER="openai"
# Start the brain
PYTHONPATH=src python3 src/run_server.py 9701
# (separate terminal) Start the frontend
python3 serve_chatael.py --port 9702
Open http://localhost:9702 in your browser. Register an account and start chatting.
All endpoints on port 9701:
| Path | Description |
|---|---|
POST /v1/auth/register | Create a new user account |
POST /v1/auth/login | Authenticate — returns API key |
POST /v1/llm/chat/stream | Streaming chat (SSE) |
GET /v1/admin/panel | Admin management panel |
GET /v1/health | Service health check |
A full OpenAPI spec is available at http://localhost:9701/docs.
| Variable | Default | Description |
|---|---|---|
LLM_PROVIDER | deepseek | LLM provider name |
DEEPSEEK_API_KEY | — | API key for DeepSeek |
OPENAI_API_KEY | — | API key for OpenAI |
AELVOXIM_EDITION | community | Edition: community / pro / enterprise |
AELVOXIM_DATABASE_URL | (none) | PostgreSQL DSN — leave unset for JSON file storage |
AELVOXIM_CONTENT_FILTER | 0 | Enable prompt injection guard |
AELVOXIM_LLM_CHECK | 0 | Enable LLM-based fact contradiction check |
aelvoxim/
├── src/
│ └── aelvoxim/
│ ├── server/ # API routes, auth, chat, tool execution
│ ├── cortex/ # Intent routing, expert orchestration
│ ├── chimera/ # Emotion engine, intent classification
│ ├── control/ # Metacognition, generation quality checks
│ ├── learn/ # Autonomous learning (35+ modules)
│ ├── memory/ # Cross-session memory, entity extraction
│ ├── proactive/ # Background proactive engine
│ ├── storage/ # Database layer (PostgreSQL + JSON fallback)
│ ├── utils/ # Utility functions
│ └── planner/ # Long-term task planning
├── frontend/ # ChatAEL-v2 SPA
├── scripts/ # CI, lint, migration helper scripts
├── tests/ # Test suite
├── serve_chatael.py # Frontend static server entry point
└── requirements.txt # Locked dependencies
MIT License — see LICENSE for details.
Note on editions: 知境 is released under MIT (open core model). The Community edition includes the full cognitive engine. Pro/Enterprise editions unlock auto-learning, curiosity-driven discovery, and meta-learner features. See
src/aelvoxim/server/edition.pyor our docs for details.
knowledge_base.md — AI agent instruction file (not user documentation)Built with no GPU required. 知境 — give your AI a memory.
GitHub checked 88h ago - refresh overdue. Recently viewed repositories target hourly refresh.