Commit Graph

27 Commits

Author SHA1 Message Date
Apple
129e4ea1fc feat(platform): add new services, tools, tests and crews modules
New router intelligence modules (26 files): alert_ingest/store, audit_store,
architecture_pressure, backlog_generator/store, cost_analyzer, data_governance,
dependency_scanner, drift_analyzer, incident_* (5 files), llm_enrichment,
platform_priority_digest, provider_budget, release_check_runner, risk_* (6 files),
signature_state_store, sofiia_auto_router, tool_governance

New services:
- sofiia-console: Dockerfile, adapters/, monitor/nodes/ops/voice modules, launchd, react static
- memory-service: integration_endpoints, integrations, voice_endpoints, static UI
- aurora-service: full app suite (analysis, job_store, orchestrator, reporting, schemas, subagents)
- sofiia-supervisor: new supervisor service
- aistalk-bridge-lite: Telegram bridge lite
- calendar-service: CalDAV calendar service with reminders
- mlx-stt-service / mlx-tts-service: Apple Silicon speech services
- binance-bot-monitor: market monitor service
- node-worker: STT/TTS memory providers

New tools (9): agent_email, browser_tool, contract_tool, observability_tool,
oncall_tool, pr_reviewer_tool, repo_tool, safe_code_executor, secure_vault

New crews: agromatrix_crew (10 modules: depth_classifier, doc_facts, doc_focus,
farm_state, light_reply, llm_factory, memory_manager, proactivity, reflection_engine,
session_context, style_adapter, telemetry)

Tests: 85+ test files for all new modules
Made-with: Cursor
2026-03-03 07:14:14 -08:00
Apple
e9dedffa48 feat(production): sync all modified production files to git
Includes updates across gateway, router, node-worker, memory-service,
aurora-service, swapper, sofiia-console UI and node2 infrastructure:

- gateway-bot: Dockerfile, http_api.py, druid/aistalk prompts, doc_service
- services/router: main.py, router-config.yml, fabric_metrics, memory_retrieval,
  offload_client, prompt_builder
- services/node-worker: worker.py, main.py, config.py, fabric_metrics
- services/memory-service: Dockerfile, database.py, main.py, requirements
- services/aurora-service: main.py (+399), kling.py, quality_report.py
- services/swapper-service: main.py, swapper_config_node2.yaml
- services/sofiia-console: static/index.html (console UI update)
- config: agent_registry, crewai_agents/teams, router_agents
- ops/fabric_preflight.sh: updated preflight checks
- router-config.yml, docker-compose.node2.yml: infra updates
- docs: NODA1-AGENT-ARCHITECTURE, fabric_contract updated

Made-with: Cursor
2026-03-03 07:13:29 -08:00
Apple
90080c632a fix(fabric): use broadcast subject for NATS capabilities discovery
NATS wildcards (node.*.capabilities.get) only work for subscriptions,
not for publish. Switch to a dedicated broadcast subject
(fabric.capabilities.discover) that all NCS instances subscribe to,
enabling proper scatter-gather discovery across nodes.

Made-with: Cursor
2026-02-27 03:20:13 -08:00
Apple
990e594a1d feat: harden memory summary — fingerprint dedup, versioning, prompt injection defense
Summary hardening:
- SHA256 fingerprint of events content for deduplication
  (skips LLM call when events unchanged since last summary)
- Versioned summary storage: summary:agent:channel:vN keys
- Latest pointer: summary_latest:agent:channel for fast retrieval
- Prompt injection defense: sanitize event content before LLM,
  strip [SYSTEM]/[INTERNAL] markers, block "ignore instructions" patterns
- Anti-injection clause in SUMMARY_SYSTEM_PROMPT

Database fix:
- list_facts_by_agent: SQL filter by fact_prefix to only return chat_events
  (prevents summary/version facts from consuming LIMIT quota)
- Fixed NULL team_id issue in UNIQUE constraint (PostgreSQL NULL != NULL)
  using "__system__" sentinel for team_id in summary operations

Tested on NODE1: dedup works (same events → skipped), force=true bypasses.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 10:26:03 -08:00
Apple
0cfd3619ea feat: auto-summarize trigger for agent memory
- Memory Service: POST /agents/{agent_id}/summarize endpoint
  - Fetches recent events by agent_id (new db.list_facts_by_agent)
  - Generates structured summary via DeepSeek LLM
  - Saves summary to PostgreSQL facts + Qdrant vector store
  - Returns structured JSON (summary, goals, decisions, key_facts)

- Gateway memory_client: auto-trigger after 30 turns
  - Turn counter per chat (agent_id:channel_id)
  - 5-minute debounce between summarize calls
  - Fire-and-forget via asyncio.ensure_future (non-blocking)
  - Configurable via SUMMARIZE_TURN_THRESHOLD / SUMMARIZE_DEBOUNCE_SECONDS

- Database: list_facts_by_agent() for agent-level queries without user_id

Tested on NODE1: Helion summarize returns valid Ukrainian summary with 20 events.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 10:15:43 -08:00
Apple
3b924118be fix: quarantine dead brand commands + implement Memory LLM summary
Brand commands (~290 lines):
- Code was trapped inside `if reply_to_message:` block (unreachable)
- Moved to feature flag: ENABLE_BRAND_COMMANDS=true to activate
- Zero re-indentation: 8sp code naturally fits as feature flag body
- Helper functions (_brand_*, _artifact_*) unchanged

Memory LLM Summary:
- Replace placeholder with real DeepSeek API integration
- Structured output: summary, goals, decisions, open_questions, next_steps, key_facts
- Graceful fallback if API key not set or call fails
- Added MEMORY_DEEPSEEK_API_KEY config
- Ukrainian output language

Deployed and verified on NODE1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 09:42:44 -08:00
Apple
ef3473db21 snapshot: NODE1 production state 2026-02-09
Complete snapshot of /opt/microdao-daarion/ from NODE1 (144.76.224.179).
This represents the actual running production code that has diverged
significantly from the previous main branch.

Key changes from old main:
- Gateway (http_api.py): expanded from ~40KB to 164KB with full agent support
- Router: new /v1/agents/{id}/infer endpoint with vision + DeepSeek routing
- Behavior Policy: SOWA v2.2 (3-level: FULL/ACK/SILENT)
- Agent Registry: config/agent_registry.yml as single source of truth
- 13 agents configured (was 3)
- Memory service integration
- CrewAI teams and roles

Excluded from snapshot: venv/, .env, data/, backups, .tgz archives

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 08:46:46 -08:00
Apple
0c8bef82f4 feat: Add Alateya, Clan, Eonarch agents + fix gateway-router connection
## Agents Added
- Alateya: R&D, biotech, innovations
- Clan (Spirit): Community spirit agent
- Eonarch: Consciousness evolution agent

## Changes
- docker-compose.node1.yml: Added tokens for all 3 new agents
- gateway-bot/http_api.py: Added configs and webhook endpoints
- gateway-bot/clan_prompt.txt: New prompt file
- gateway-bot/eonarch_prompt.txt: New prompt file

## Fixes
- Fixed ROUTER_URL from :9102 to :8000 (internal container port)
- All 9 Telegram agents now working

## Documentation
- Created PROJECT-MASTER-INDEX.md - single entry point
- Added various status documents and scripts

Tokens configured:
- Helion, NUTRA, Agromatrix (existing)
- Alateya, Clan, Eonarch (new)
- Druid, GreenFood, DAARWIZZ (configured)
2026-01-28 06:40:34 -08:00
Apple
5290287058 feat: implement TTS, Document processing, and Memory Service /facts API
- TTS: xtts-v2 integration with voice cloning support
- Document: docling integration for PDF/DOCX/PPTX processing
- Memory Service: added /facts/upsert, /facts/{key}, /facts endpoints
- Added required dependencies (TTS, docling)
2026-01-17 08:16:37 -08:00
Apple
38cb96dd68 🔐 Auth: інтеграція JWT в Memory Service + конфігурації
- Опціональна JWT auth в Memory Service endpoints
- get_current_service_optional для backward compatibility
- NATS auth config (nkeys) - шаблони
- Qdrant auth config (API keys) - шаблони
- Тестовий скрипт для повного потоку

TODO: Генерація реальних JWT/ключів та застосування конфігів
2026-01-10 10:46:25 -08:00
Apple
6c426bc274 🔐 Auth: базова реалізація JWT для Memory Service
- JWT middleware для FastAPI
- Генерація/перевірка JWT токенів
- Скрипти для генерації Qdrant API keys
- Скрипти для генерації NATS operator JWT
- План реалізації Auth

TODO: Додати JWT до endpoints, NATS nkeys config, Qdrant API key config
2026-01-10 10:43:14 -08:00
Apple
3478dfce5f 🔒 КРИТИЧНО: Видалено паролі/API ключі з документів + закрито NodePort
Some checks failed
Build and Deploy Docs / build-and-deploy (push) Has been cancelled
- Видалено всі паролі та API ключі з документів
- Замінено на посилання на Vault
- Закрито NodePort для Memory Service (тільки internal)
- Створено SECURITY-ROTATION-PLAN.md
- Створено ARCHITECTURE-150-NODES.md (план для 150 нод)
- Оновлено config.py (видалено hardcoded Cohere key)
2026-01-10 09:46:03 -08:00
Apple
90758facae 🧠 Add Agent Memory System with PostgreSQL + Qdrant + Cohere
Features:
- Three-tier memory architecture (short/mid/long-term)
- PostgreSQL schema for conversations, events, memories
- Qdrant vector database for semantic search
- Cohere embeddings (embed-multilingual-v3.0, 1024 dims)
- FastAPI Memory Service with full CRUD
- External Secrets integration with Vault
- Kubernetes deployment manifests

Components:
- infrastructure/database/agent-memory-schema.sql
- infrastructure/kubernetes/apps/qdrant/
- infrastructure/kubernetes/apps/memory-service/
- services/memory-service/ (FastAPI app)

Also includes:
- External Secrets Operator
- Traefik Ingress Controller
- Cert-Manager with Let's Encrypt
- ArgoCD for GitOps
2026-01-10 07:52:32 -08:00
Apple
3de3c8cb36 feat: Add presence heartbeat for Matrix online status
- matrix-gateway: POST /internal/matrix/presence/online endpoint
- usePresenceHeartbeat hook with activity tracking
- Auto away after 5 min inactivity
- Offline on page close/visibility change
- Integrated in MatrixChatRoom component
2025-11-27 00:19:40 -08:00
Apple
16630acf0e feat: add memory-service and postgres for Helion agent
- Add PostgreSQL database in docker-compose.yml
- Add memory-service with health checks
- Create database schema (init.sql) with user_facts, dialog_summaries, agent_memory_events
- Add deployment documentation (DEPLOY-NOW.md)
- Add status reports and troubleshooting guides
2025-11-16 12:52:23 -08:00
Apple
a31e5dbf7e fix: synchronize all metadata fields to meta in schemas
- Fix UserFactUpsertRequest.metadata -> meta
- Fix DialogSummaryBase.metadata -> meta
- All schemas now use meta consistently
2025-11-15 12:31:01 -08:00
Apple
3698a0d2a1 refactor: remove all ForeignKey constraints for testing (variant A)
- Remove all FK constraints from models (users, teams, channels, agents)
- Keep fields as optional nullable String for testing DAARWIZZ
- Update SQL migration to remove all REFERENCES
- Fix metadata -> meta in migration
- Allows service to work without base tables for testing
2025-11-15 12:24:45 -08:00
Apple
7afcffd0bd fix: remove teams foreign key constraint from UserFact
- Remove FK constraint from UserFact.team_id (teams table may not exist)
- Update SQL migration to remove FK constraint
- team_id remains optional String field without FK
2025-11-15 12:01:06 -08:00
Apple
b1a80b8fed fix: rename last remaining metadata field to meta in AgentMemoryFactsVector
- Fix AgentMemoryFactsVector.metadata -> AgentMemoryFactsVector.meta
- All metadata fields now completely renamed to meta
2025-11-15 11:58:33 -08:00
Apple
3017f5f9b9 fix: rename remaining metadata fields to meta in models.py
- Fix DialogSummary.metadata -> DialogSummary.meta
- Fix AgentMemoryFactsVector.metadata -> AgentMemoryFactsVector.meta
- All metadata fields now renamed to meta
2025-11-15 11:58:26 -08:00
Apple
734b6ab850 fix: rename metadata field to meta (metadata is reserved in SQLAlchemy)
- Rename metadata to meta in all models (UserFact, DialogSummary, AgentMemoryFactsVector)
- Update schemas to use meta instead of metadata
- Update SQL migration to use meta column name
- Fixes SQLAlchemy reserved name conflict
2025-11-15 11:54:39 -08:00
Apple
f7c0a0fc08 fix: move CheckConstraint to __table_args__ in AgentMemoryEvent model
- Fix syntax error on line 115-116
- Move CheckConstraint from Column parameters to __table_args__
- Add proper constraint names
2025-11-15 11:49:34 -08:00
Apple
d50765f2ff feat: add memory-service to docker-compose.yml
- Add memory-service as a service (not under networks:)
- Create Dockerfile for memory-service
- Configure depends_on city-db with healthcheck condition
- Set DATABASE_URL to connect to city-db
2025-11-15 11:40:07 -08:00
Apple
7aa0745877 refactor: reorganize memory-service into app/ directory structure
- Move models.py, schemas.py, crud.py, main.py to app/
- Update imports to use app.* prefix
- Update README with new structure
- Fix uvicorn run command for new structure
2025-11-15 10:14:26 -08:00
Apple
6d5d83c347 Merge feature/memory-service into main 2025-11-15 10:12:59 -08:00
Apple
9e99c3afe2 feat: add Memory Service for DAARWIZZ 2025-11-15 10:12:37 -08:00
Ivan Tytar
7b360fc360 fix: Gateway response extraction and GPU optimization
- Fixed Gateway to extract response from data.text field
- GPU working: RTX 4000 Ada, response time 7-10s (was 30-40s)
- DAARWIZZ now responds correctly with full personality
- Started Memory Service structure
2025-11-15 18:55:09 +01:00