Commit Graph

50 Commits

Author SHA1 Message Date
zhanghui f20a123805 fix(observability): correct span typing and telemetry shape
Follow-up to the live-trace audit — all on the enabled path:

- boundary detection LLM (everalgo detect_boundaries) ran with the
  SPAN-typed request root as the current span, so its ~1.2k tokens were
  dropped from cost. Wrap it in an everos.memcell.boundary GENERATION
  span so Langfuse prices it.
- embedding calls stamped usage on the enclosing retriever span. Wrap
  each /embeddings call in an everos.embedding EMBEDDING span so the type
  is correct and pricing can apply.
- agentic recall emitted a duplicate, same-name everos.search.recall
  (cluster_scoped wrapping hybrid_full, which owns the real recall span).
  Drop the redundant outer span; hybrid_full keeps the one recall span
  (also used standalone in round 2).
- search now captures the returned hit ids (episodes/cases/skills) as
  observation output when capture_content is on — previously only the
  query input was captured.
- add/flush spans carry request_id in metadata.
- persist captures the memory-root-relative .md path, not the host
  absolute path (no host layout leak to the telemetry backend).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:29:54 +08:00
zhanghui 0cbfb9f854 fix(observability): address OTel review findings
Adversarial review of the merged OTel instrumentation (#352) surfaced
four issues, all on the enabled path (default-off, so no impact until
tracing is turned on):

- search LLM client was unwrapped, so hybrid/agentic token usage — the
  heaviest LLM spend — never reached Langfuse. Wrap it with
  UsageRecordingClient when observability is enabled, mirroring
  get_llm_client(); graceful keyword-only degradation is preserved.
- set_generation_usage overwrote token counts, undercounting any span
  that wraps more than one chat call (the now-wrapped agentic path).
  Accumulate instead of replacing.
- recall_hit was emitted for uncalibrated methods (unbounded BM25 /
  single-route vector), a near-constant always-hit signal that inflates
  dashboards. Gate hit on calibrated methods (HYBRID/AGENTIC); keyword
  and vector emit only the raw top_score.
- init_tracing / init_score_sink were not idempotent — a re-init without
  an intervening shutdown orphaned the export thread + OTLP socket +
  worker task. Tear down the previous instance first (init_score_sink is
  now async).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 15:29:54 +08:00
zhanghui a59d385d23
Merge pull request #356 from EverMind-AI/feat/api-v2-alias
feat(api): serve endpoints under /api/v2, retain /api/v1 as alias
2026-07-24 15:29:24 +08:00
zhanghui 21b845bf88 feat(api): serve endpoints under /api/v2, retain /api/v1 as alias
Every business endpoint (memory/*, ome/*, knowledge/*) is now served
under /api/v2, aligning the open-source API with the EverOS Cloud
contract. /api/v1 is retained as a permanent, backward-compatible alias:
the same router objects are mounted under both prefixes, so both resolve
to identical handlers and request/response contracts. Existing /api/v1
integrations keep working unchanged. Infra endpoints (/health, /metrics)
stay unversioned.

Fix the Prometheus request-metric label to build the path from the full
request URL (with path params folded) rather than the route's
router-relative path, so the version prefix is preserved and v1/v2
traffic stays distinguishable.

Docs (docs/api.md, docs/openapi.json), CHANGELOG, and route docstrings
updated to lead with /api/v2. Add test_api_versioning as the parity
guard: every v2 route has an identical v1 twin and vice versa.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 13:44:58 +08:00
zhanghui c4c2977898
Merge pull request #352 from EverMind-AI/feat/otel-instrumentation
feat: native OpenTelemetry instrumentation (optional, off by default)
2026-07-24 13:08:10 +08:00
zhanghui 357f619c64 feat(observability): instrument memory ops + OME trace linking
Open spans at the memory hot paths (all no-op when tracing is off):

- add / flush (service.memorize), extract + persist.markdown (user pipeline).
- search: everos.memory.search retriever + a uniform recall / rank
  decomposition across keyword / vector / hybrid / agentic (manager, agentic
  modules, cross-encoder callbacks); query-embedding tokens land on recall.
- recall quality: top_score / hit on the search span, plus recall_top_score /
  recall_hit pushed to Langfuse scores via the bounded-queue sink (method
  tagged; off the request path).
- OME: everos.ome.<strategy> agent span + everos.reflect.consolidate
  generation; a W3C traceparent captured at enqueue is threaded through the
  APScheduler job and re-attached in the Runner, so strategies fanned out
  from a request nest under that request's trace.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:47:39 +08:00
zhanghui bd26f5a80f feat(observability): capture LLM + embedding token usage
Surface gen_ai.* model + token attributes onto the active span so Langfuse
can compute cost — without touching everalgo:

- UsageRecordingClient wraps the LLM client and records response.usage after
  each chat(); get_llm_client composes it over the existing _LoggingLLMClient
  only when observability is enabled (disabled default stays overhead-free).
- OpenAIEmbeddingProvider records its response.usage (input tokens) onto the
  active span too.

Tokens land on the everos.extract / everos.reflect.consolidate generation
spans and the search embedding recall; no-op when tracing is off.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:47:39 +08:00
zhanghui ab5cf0447e feat(observability): OTel tracing chassis + request-id propagation
Optional, off-by-default native OpenTelemetry export (the [otel] extra),
wired as chassis so call sites never branch on config:

- ObservabilitySettings ([observability]) — enabled / endpoint / headers /
  sample_rate / capture_content / langfuse_* / recall_hit_threshold; langfuse
  creds derive the OTLP endpoint + Basic-auth header.
- core.observability.tracing: TracerProvider lifecycle (module-local, no-op
  when off/absent), memory_span helper stamping the langfuse.* contract,
  set_generation_usage, privacy-gated capture_input/output (redaction +
  truncation), non-blocking recall-score sink, W3C traceparent in/out helpers.
- TracingLifespanProvider builds provider + score sink at startup.
- RequestIdMiddleware: per-request id (state + contextvar + structlog +
  X-Request-Id) and continues an upstream traceparent when present; managers
  read the propagated id via resolve_request_id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:47:39 +08:00
Elliot Chen 02dae05cbc
chore(release): update EverOS to 1.1.4 (#348) 2026-07-23 13:18:19 +08:00
Dani d3a9f9e394
docs(examples): make Langfuse wrapper degrade cleanly on a real server (#342)
* docs(examples): make Langfuse wrapper degrade cleanly on a real server

The wrapper synthesized child spans (extraction, embedding, hybrid
recall, rerank, index sync, consolidation) from a mock-only `_detail`
field. Against a real EverOS server that field is absent, so those spans
rendered with placeholder data — hardcoded model names, token=0, fixed
sleep durations — and recall scores fell to 0.

Now the per-stage child spans are emitted only when `_detail` is present
(the mock, or future native in-core instrumentation). Against a live
server only the top-level span per operation is emitted, with real
latency and output — no fabricated data. Recall quality
(recall_top_score / recall_hit) is derived from the real search
response, which already carries a per-hit score, so it works against a
live server today, not just the mock.

Verified: mock path unchanged (full trace tree, real scores); real-ish
path (no `_detail`) emits only top-level spans plus a real recall score.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(examples): count empty recalls as a miss in Langfuse hit-rate

When a search returns nothing scored, record recall_hit=0 (span attribute +
Langfuse score) instead of omitting it, so genuine empty recalls still show
up in recall hit-rate. No top_score is emitted (there is no hit to score).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 07:02:16 +08:00
Dani a1e21ca676
docs(examples): add Langfuse (OpenTelemetry) integration example (#339)
Adds examples/langfuse/ — a thin OpenTelemetry wrapper that traces EverOS
memory operations (add / flush+extract / search / reflection) into Langfuse,
with recall quality pushed as Langfuse scores. Pure OTel SDK, no Langfuse
package dependency; runs against a built-in mock or a real EverOS server
(EVEROS_BASE_URL). Additive only, no changes to EverOS core.

Referenced by the upcoming Langfuse docs integration cookbook.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 07:46:29 +08:00
zhanghui 45656d331e
fix(lancedb): fix FTS with_position optimize crash + disk bloat (#336)
FTS indexes built with with_position=True crash lance's optimize/compaction
on lancedb >= 0.32 when merging an unindexed tail (Max offset exceeds length
of values; upstream lance-format/lance#7653). The crash aborts optimize()
including version cleanup, so the index dir grows unbounded until the disk
fills. everos recall is OR-mode BM25 and never does phrase queries, so
positions are never read -- disabling is lossless.

- base: default with_position=False
- infra: migrate_fts_indexes() rebuilds pre-fix indexes once at startup + reclaims orphans
- cascade worker: count consecutive optimize failures, escalate warning->error

Fixes #335.

Co-authored-by: zhanghui <zhanghui@shanda.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 16:54:58 +08:00
Kendrick-Song 56ee9c8e5c
fix(search): scope deprecated_by filter to user tables only (#330)
compile_filters() unconditionally appended 'deprecated_by IS NULL' to
every query, but the deprecated_by column only exists on user-scoped
tables (episode, atomic_fact — Reflection V1). Agent tables
(agent_case, agent_skill) lack this column, causing a SQL error on
agent search/get queries.

Gate the clause behind owner_type == 'user' so agent queries no longer
reference a non-existent column.

Bump version to 1.1.2.

Co-authored-by: Jiayao Song <jiayao.song@shanda.com>
2026-07-08 11:17:01 +08:00
Elliot Chen 15efd1198c
chore(release): update EverOS to 1.1.1 (#327) 2026-07-07 18:30:03 +08:00
Elliot Chen 66a201e164
docs(readme): add raven ecosystem entry (#322) 2026-07-03 08:51:18 +08:00
Elliot Chen 0341f1230f
docs: align config and github workflow (#314)
* docs: align config and positioning copy

* docs: remove internal branch workflow residue

* docs: record github sync guard

* chore: retrigger commit lint

* docs: leave readme files unchanged

* docs: remove public positioning comparison
2026-06-29 07:31:31 +08:00
Dani b7d15f7252
docs: re-link orphaned docs and slim engineering.md (#313)
* docs: re-link orphaned docs and slim engineering.md

After #311 realigned the docs, index.md again omitted four files that
exist under docs/: everos-demo, use-cases, migration-to-1.0.0, and
release-notes-1.1.0. Restore them so every docs/*.md is reachable from
the index, and rewrite engineering.md for an external audience.

index.md:
- Re-add a Tutorials section: everos-demo, use-cases
- See also: + release-notes-1.1.0, + migration-to-1.0.0
- Reframe the Engineering section as contributor-facing (not "internal")

engineering.md (575 -> 113 lines):
- Drop internal-only material: the self-justifying scope rationale, the
  Claude Code loading internals, the infra failure-impact table, the
  roadmap, and the "investing in infrastructure" essay
- Fix claims that were false for this GitHub repo: GitLab-primary CI,
  the dev/master branch model, and the Gitmoji commit convention
- Keep what helps a contributor: toolchain, local make targets, the CI
  gates, and the main-branch + Conventional Commits workflow

Conventions now match the repo's own .gitlint and GitHub Actions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: align engineering.md references with the slimmed doc

Update the inbound descriptions of engineering.md now that it is a
contributor reference rather than an "infrastructure overview", and
repoint the one reference that named content the trim removed.

- CLAUDE.md, README, README.zh-CN, architecture.md: reword the link
  text to "contributor engineering reference: build, test, CI, conventions"
- CLAUDE.md: the GitFlow Lite rationale pointer now targets
  .claude/skills/new-branch/SKILL.md (engineering.md no longer carries it)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 07:40:51 +08:00
Elliot Chen bdd702c43b
docs(readme): restore pre-trim overview (#312) 2026-06-25 15:19:49 +08:00
Kendrick-Song bf9b8d1053
docs: align docs with v1.1 and trim README (#311)
Co-authored-by: Jiayao Song <jiayao.song@shanda.com>
2026-06-25 14:59:47 +08:00
Dani e14e9a59fa
docs: index all docs and add a Tutorials section (#310)
index.md only linked 12 of the 19 docs under docs/. Readers entering
from the index missed configuration, multimodal, demo, use-cases,
benchmark, migration, and release notes.

- Add a Tutorials section (Diátaxis 4th quadrant): everos-demo, use-cases
- Reference: + configuration, + multimodal
- How-to: + locomo_benchmark, + migration-to-1.0.0
- See also: + release-notes-1.1.0

Every docs/*.md (excluding the openapi.json artifact) is now linked.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 08:01:14 +08:00
Elliot Chen 9328442b5c
docs(readme): sync chinese 1.1 feature positioning (#309) 2026-06-24 23:28:48 +08:00
Elliot Chen 289e78b11e
docs(readme): promote 1.1 knowledge and reflection (#308) 2026-06-24 23:24:00 +08:00
Elliot Chen 0df88f5603
chore(release): update EverOS to 1.1.0 (#307) 2026-06-24 23:17:23 +08:00
Elliot Chen 1ea44ca548
feat(cli): add live demo mode (#302) 2026-06-23 20:11:23 +08:00
Elliot Chen 62e50ab725
docs(readme): remove demo hosting sentence (#301) 2026-06-23 19:44:41 +08:00
Elliot Chen 54b374bfb4 docs(readme): clarify provider key setup 2026-06-23 19:12:43 +08:00
Elliot Chen 27a3396d23 docs(readme): sync chinese onboarding 2026-06-23 19:02:29 +08:00
Elliot Chen cdcf4ad0ad docs(readme): remove early back-to-top links 2026-06-23 18:50:19 +08:00
Elliot Chen 16a884b0d2 docs(readme): clarify no-key demo onboarding 2026-06-23 18:40:00 +08:00
Elliot Chen 32cb22343d
feat(cli): add EverOS demo TUI (#298)
* feat: add EverOS demo TUI

* docs: add EverOS demo quick start

* style(cli): elevate EverOS demo TUI

* style(cli): align demo palette with poster

* fix(cli): round demo sphere animation loop

* fix(cli): refine EverOS demo TUI layout

* fix(cli): use uniform demo sphere dots

* fix(cli): refine EverOS demo sphere media

* fix(docs): smooth EverOS demo animation

* fix(docs): raise demo animation frame rate

* docs(readme): note external demo animation hosting

* fix(docs): optimize demo animation size

* feat(cli): add demo confetti success state

* feat(cli): make demo playable

* test(cli): normalize demo help ansi output

* docs(readme): streamline demo and roadmap sections

* docs(readme): restore star history section

* refactor(tui): move demo implementation out of cli
2026-06-23 18:33:44 +08:00
Elliot Chen dbfe3483f5
docs: simplify README reflection wording (#296) 2026-06-18 08:44:54 +08:00
Yangtze-Seventh dc02b2fbab
feat(rerank): add Bailian DashScope provider support (#295) 2026-06-17 20:19:42 +08:00
Elliot Chen 5a821acf20
docs: fix Discord community links (#294) 2026-06-17 17:16:13 +08:00
Elliot Chen 9c7c9d7316
docs: make quick start prove first memory (#293)
* docs: make quick start prove first memory

* docs: add env example for quick start

* docs: highlight quick start success moment

* docs: move use cases after quick start

* docs: align quickstart response contracts
2026-06-17 13:15:59 +08:00
Elliot Chen a10cdcd197
chore(release): prepare EverOS 1.0.1 (#290) 2026-06-16 21:46:17 +08:00
Elliot Chen 859c35a3b0
docs: explain upcoming knowledge wiki and reflection (#289)
* docs: explain upcoming knowledge wiki and reflection

* docs: tighten roadmap summary in readmes

* docs: add memory library comparison table

* docs: make memory comparison a named matrix

* docs: use category comparison for memory positioning

* docs: sharpen readme comparison table

* docs: refine everme readme positioning

* docs: correct readme positioning title to everos

* docs: simplify readme comparison table

* docs: clarify reflection idle behavior
2026-06-16 21:08:46 +08:00
Elliot Chen f47ee5f51c
docs: update README banner (#288) 2026-06-15 19:06:30 +08:00
Dani 648b34b22c
docs: add multimodal memory guide (#278)
* docs: add multimodal memory guide

Add docs/multimodal.md covering the full multimodal ingest flow:
supported modalities, prerequisites, payload formats (uri / base64 /
file://), configuration reference, error semantics, and search.
Wire it into docs/index.md under the How-to section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ci: retrigger integration tests

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 09:55:39 +08:00
0xVox 9fc6ad20d2
fix(docs): repair dead xrefs in api.md, runbook, skill (#269)
Three internal documentation references pointed at non-existent targets:

- docs/api.md: MessageItem.content linked to #addmessage, which has no
  heading or anchor; corrected to #messageitem (the slug used by every
  other MessageItem cross-reference and matching the ### MessageItem
  heading).
- docs/cascade_runbook.md: the FD-exhaustion cross-ref used a single
  hyphen where the GitHub slug of "FD exhaustion (`os error 24` /
  EMFILE)" has a double hyphen (from the ` / ` separator); corrected to
  #fd-exhaustion-os-error-24--emfile.
- use-cases/claude-code-plugin/skills/memory-tools.md: the always-injected
  skill named two tools (search_memories, get_memory) that the MCP server
  never exposes; replaced with the real evermem_search tool and its
  params (query required, limit default 10 / max 20).

Markdown-only; no runtime behavior change.
2026-06-08 07:10:56 +08:00
Elliot Chen 306dcfe167
docs(readme): clarify hybrid retrieval wording (#265) 2026-06-07 08:54:08 +08:00
Elliot Chen 28977ba295
docs(readme): polish repository presentation (#263)
* docs(readme): refine repository watch section

Replace the Stay Tuned section with a clearer Watch EverOS call to action in both English and Chinese READMEs.

Remove the star GIF and keep star history as lighter social proof.

* docs(readme): improve highlights table spacing

Add spacing below each feature title in the EverOS highlights table.

Mirror the same table spacing in the Chinese README.
2026-06-06 21:47:35 +08:00
Elliot Chen 0bbfb3bf1e
docs(readme): clarify EverOS positioning (#262)
Rename the overview section to focus on why EverOS matters in both English and Chinese READMEs.

Simplify the EverMind ecosystem copy around EverOS as the core memory architecture and mirror that positioning in the Chinese README.
2026-06-06 21:15:10 +08:00
Elliot Chen 79b3df4de2
docs(readme): polish launch highlights and banner (#261)
* docs: simplify README launch highlights

* docs(readme): use six launch highlights

* docs(readme): use optimized banner asset

* ci: lint pull request titles
2026-06-06 19:49:59 +08:00
Elliot Chen 0a99922f24
docs: add EverMind ecosystem overview (#259)
* docs: add EverMind ecosystem overview

* docs: move ecosystem overview lower

* docs: add EverOS 1.0.0 highlights

* docs: streamline README flow

* docs: refine README showcase layout

* docs: update README banner image

* docs: use uploaded README banner

* docs: expand README highlights and navigation

* docs: normalize README title capitalization

* docs: align EverOS description with banner

* docs: use high-density README banner

* docs: clarify EverOS overview

* docs: add README localization and star history

* docs: expand Chinese README localization
2026-06-06 18:49:45 +08:00
Elliot Chen 8f175d3f8f
docs: document EverOS 1.0.0 issue migration (#258)
* docs: document EverOS 1.0 issue migration

* docs: standardize EverOS 1.0.0 wording
2026-06-06 14:33:00 +08:00
Elliot Chen 00f1dfaec5
chore: finalize repo audit hygiene (#257) 2026-06-06 13:59:12 +08:00
Elliot Chen ab23e40b28
ci: block repository media assets (#256)
* ci: block repository media assets

* test: stabilize cascade scanner loop test
2026-06-06 11:44:45 +08:00
Elliot Chen 873e7535fb
ci: harden contributor checks (#254)
* ci: harden contributor checks

* ci: pin setup-uv action release

* ci: split workflow checks

* docs: clarify required checks
2026-06-06 10:47:16 +08:00
Elliot Chen 3527ea3eb2 ci: fix docs and integration checks 2026-06-06 08:51:41 +08:00
Elliot Chen 518b8eca85 chore: initialize EverOS 1.0.0
md-first memory extraction framework for AI agents.

Markdown is the single source of truth; SQLite holds state and LanceDB
provides the rebuildable vector + BM25 + scalar index. The codebase follows
a single-direction DDD layering (entrypoints -> service -> memory -> infra,
with component / core / config cross-cutting) enforced by import-linter.

Engineering surface:
- Coding conventions in .claude/rules/ (path-scoped) and workflows in
  .claude/skills/ (/commit, /new-branch, /pr).
- GitHub Actions CI runs make lint + test + integration; pre-commit mirrors
  the gates locally (ruff, hygiene hooks, gitlint commit-msg).
- Commit messages follow Conventional Commits, enforced by gitlint.
- make lint also enforces datetime two-zone discipline and OpenAPI drift.
2026-06-06 07:33:17 +08:00