Commit Graph

64 Commits

Author SHA1 Message Date
serversdown 194e3e64b9 feat: import raw ChatGPT export (new sharded format)
OpenAI's export changed: conversations.json is now sharded into
conversations-000.json..NNN.json, each a JSON array of conversations with the
mapping tree and per-message create_time.

ingest now reads that format directly (supersedes the old convert/trim/split
scripts): walks each conversation's mapping ordered by create_time, keeps text
and multimodal_text (drops thoughts/reasoning_recap), captures real per-message
timestamps, and imports idempotently by conversation_id. `lyra-import <dir>`
auto-detects raw-export vs legacy {title,messages} dirs; optional limit arg.

Verified on 15 conversations: real dates, correct ordering, recall returns
dated poker history.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 02:40:32 +00:00
serversdown 938305f17d chore: update gitignore for export data 2026-06-16 02:36:54 +00:00
serversdown f3037b7879 feat: ChatGPT chat-log importer
Import the parser's {title, messages} JSON into Lyra's memory so past
conversations seed recall (and, later, the era-rollup tier).

- lyra/ingest.py: one conversation -> one session, text messages -> exchanges;
  skips non-text (image asset) messages and non user/assistant roles; embeddings
  batched; idempotent by filename-derived session id; `lyra-import <dir>` CLI
- memory.add_exchanges_bulk: batched insert of pre-embedded rows

Format has no timestamps yet, so imports are stamped at import time; a future
dated export will let era memory group by real calendar time.

Verified on the 68-file lyra dev set: 7519 exchanges, idempotent re-run, recall
returns relevant history.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 00:51:45 +00:00
serversdown 236a16b331 feat: inspect the full prompt in the live log
The "context built" event now carries the fully-rendered prompt (persona, gists,
recalled details, recent turns, the new message) plus a total char count. The
log panel renders it as a collapsed "view full prompt" block — clean by default,
one click to see exactly what hit the model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 23:52:35 +00:00
serversdown d7c258eba0 feat: tiered, compacting memory (phase 1.5)
Older sessions fade to a general idea; details stay retrievable.

- memory: summaries table (one compacted gist per session, embedded), plus
  store_summary/get_summary/recall_summaries and unsummarized_count (tracks
  exchanges newer than the current summary)
- lyra/summary.py: summarize_session compacts a session's raw turns into a
  third-person gist (default SUMMARY_BACKEND=local, so compaction is free);
  maybe_summarize re-summarizes once SUMMARIZE_AFTER new turns accumulate
- chat.build_messages now layers context in tiers: persona -> gists of other
  sessions -> a few sharp raw cross-session details -> current session raw
  turns -> new message; respond() compacts the session after each turn
- web: POST /sessions/{id}/summarize to compact on demand
- summarization activity surfaces in the live log

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 18:52:58 +00:00
serversdown 84c4f75e03 feat: in-app live log (SSE activity feed)
Turn the inert "Show Work" thinking panel into a real live activity log:
- lyra/logbus.py: thread-safe in-memory ring buffer other modules publish to
- chat.respond logs backend/model/embed per turn, recall counts, reply size;
  web layer logs chat errors
- server: replace the keep-alive /stream/thinking stub with /stream/logs, an
  SSE endpoint that replays the recent buffer then streams new events
- UI: repurpose the panel as a global "Live Log" — connects on load, renders
  level/time/msg/fields, drops the old per-session localStorage + dead popup

Every turn now shows its backend + model in-app, so local-vs-cloud (free vs
paid) is visible at a glance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 18:45:05 +00:00
serversdown 3b9e0bb1e0 feat: persona chat loop, web UI, and local (Ollama) embeddings
Phase 1 — persona + persistent memory chat loop:
- lyra/persona.py + personas/lyra.md: editable identity/voice (friend-first,
  honest, never invents poker math)
- lyra/chat.py: turn loop assembling persona + cross-session recall + recent
  context, persisting both sides to SQLite
- lyra/session.py, lyra/__main__.py: session lifecycle + `lyra` REPL

Phase 1.25 — reuse the old web UI:
- vendored the prior single-page UI into lyra/web/static, repointed to
  same-origin
- lyra/web/server.py (FastAPI): serves the UI and backs its endpoint contract
  (/v1/chat/completions, session CRUD, health, inert thinking-stream) with the
  new chat loop + memory; SQLite stays the single source of truth
- `lyra-web` console script

Local backends — test for free, no OpenAI key:
- llm.embed routes via EMBED_BACKEND (cloud=OpenAI, local=Ollama /api/embed)
- simplified UI backend selector to Local (Ollama) / Cloud (OpenAI), default local
- memory connection opened check_same_thread=False for the threaded server

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 18:36:31 +00:00
serversdown 6d88505697 chore: add sessions to gitignore 2026-05-29 18:23:29 -04:00
Claude 0ee5a9ce47 feat: SQLite-backed memory with brute-force cosine recall
- lyra.memory.remember(session_id, role, content) embeds and stores
- lyra.memory.recent(session_id, n) returns the last N from a session
- lyra.memory.recall(query, k, session_id=None) returns top-k by cosine
  similarity across the chosen scope (all sessions by default)
- Embeddings live in the exchanges.embedding BLOB column as float32 bytes
- Connection reopens automatically if LYRA_DB_PATH changes (test-friendly)
2026-05-16 06:35:52 +00:00
Claude 6a1255dfdb feat: LLM router with local (Ollama) and cloud (OpenAI) backends
- lyra.config.load() reads env into a frozen Config dataclass
- lyra.llm.complete(messages, backend) routes to Ollama /api/chat or
  OpenAI chat completions
- lyra.llm.embed(texts) calls OpenAI embeddings
- .env.example switched from Anthropic to OpenAI to match available key
2026-05-16 06:10:48 +00:00
Claude b2523c2561 chore: project scaffold (uv, .env.example, README, lyra package) 2026-05-16 06:01:08 +00:00
Claude faf4e8a1aa chore: nuke legacy code, keep design docs for restart
Preserved on the archive branch. Keeping only the architecture and
design thinking that survives the rewrite:

- docs/ARCH_v0-6-1.md (Inner Self / Executive / Chat / Persona model)
- docs/ARCHITECTURE_v0-6-0.md (predecessor architecture)
- docs/PROJECT_SUMMARY.md (project history and rationale)
- docs/PROJECT_LYRA_COMPLETE_BREAKDOWN.md (detailed design notes)
- docs/ENVIRONMENT_VARIABLES.md (multi-backend env conventions)
- docs/LLMS.md
- docs/TRILLIUM_API.md (for future tool integration)

Removed: all service code (cortex, core/relay, neomem, rag, sandbox,
persona-sidecar), docker-compose, migration/logging docs, stale root
test scripts, CHANGELOG.
2026-05-16 05:57:07 +00:00
claude 4b951f3be8 Merge pull request #16 from serversdwn/dev
update to 0.9.0
2025-12-29 01:59:14 -05:00
claude 6b5580a80e 0.9.0 - Added Trilium ETAPI integration.
Lyra can now: Search trilium notes and create new notes. with proper ETAPI auth.
2025-12-29 01:58:20 -05:00
claude 86b37ab874 feat: Implement Trillium notes executor for searching and creating notes via ETAPI
- Added `trillium.py` for searching and creating notes with Trillium's ETAPI.
- Implemented `search_notes` and `create_note` functions with appropriate error handling and validation.

feat: Add web search functionality using DuckDuckGo

- Introduced `web_search.py` for performing web searches without API keys.
- Implemented `search_web` function with result handling and validation.

feat: Create provider-agnostic function caller for iterative tool calling

- Developed `function_caller.py` to manage LLM interactions with tools.
- Implemented iterative calling logic with error handling and tool execution.

feat: Establish a tool registry for managing available tools

- Created `registry.py` to define and manage tool availability and execution.
- Integrated feature flags for enabling/disabling tools based on environment variables.

feat: Implement event streaming for tool calling processes

- Added `stream_events.py` to manage Server-Sent Events (SSE) for tool calling.
- Enabled real-time updates during tool execution for enhanced user experience.

test: Add tests for tool calling system components

- Created `test_tools.py` to validate functionality of code execution, web search, and tool registry.
- Implemented asynchronous tests to ensure proper execution and result handling.

chore: Add Dockerfile for sandbox environment setup

- Created `Dockerfile` to set up a Python environment with necessary dependencies for code execution.

chore: Add debug regex script for testing XML parsing

- Introduced `debug_regex.py` to validate regex patterns against XML tool calls.

chore: Add HTML template for displaying thinking stream events

- Created `test_thinking_stream.html` for visualizing tool calling events in a user-friendly format.

test: Add tests for OllamaAdapter XML parsing

- Developed `test_ollama_parser.py` to validate XML parsing with various test cases, including malformed XML.
2025-12-26 03:49:20 -05:00
claude 8b66cd1e1d update to 0.7.0
Standard Mode Implementation - Complete documentation of the new simple chatbot mode
Backend Selection System - UI settings modal and routing changes
Session Management Overhaul - File-based persistence with CRUD API
UI Improvements - Settings modal, light/dark mode, modal fixes
Context Retention - Integration with Intake for conversation history
Architecture & Routing Changes - Updates to Relay, Cortex, Intake, LLM router
Fixed Critical Issues - DeepSeek R1, context retention, OpenAI errors, modal formatting, session persistence
Technical Improvements - Backward compatibility, code quality, performance
Architecture Diagrams - Data flow for Standard Mode, Cortex Mode, and sessions
Known Limitations - Standard Mode constraints, session management limits
Migration Notes - For users and developers upgrading
2025-12-22 01:41:21 -05:00
claude 7cb7033bb6 docs updated v0.7.0 2025-12-22 01:40:24 -05:00
claude 9226b2480b sessions improved, v0.7.0 2025-12-21 15:50:52 -05:00
claude 58d0afd1c6 mode selection, settings added to ui 2025-12-21 14:30:32 -05:00
claude 9c03b23a6d simple context added to standard mode 2025-12-21 13:01:00 -05:00
claude fdc51e598c v0.7.0 - Standard non cortex mode enabled 2025-12-20 04:15:22 -05:00
claude 092ac4d181 Cortex debugging logs cleaned up 2025-12-20 02:49:20 -05:00
claude a4f5308f9b Merge pull request #9 from serversdwn/dev
Update to 0.6.0. Docs updated.
2025-12-19 17:44:11 -05:00
claude 34aff34038 Docs updated v0.6.0 2025-12-19 17:43:22 -05:00
claude a41e342dbd cleanup ignore stuff 2025-12-17 02:46:23 -05:00
claude 09c00848b9 Merge branch 'dev' of https://github.com/serversdwn/project-lyra into dev 2025-12-17 01:47:30 -05:00
claude ec5f17694e ignore 2025-12-17 01:47:19 -05:00
claude b74658c000 complete breakdown for AI agents added 2025-12-15 11:49:49 -05:00
claude 0a03546039 neomem disabled 2025-12-15 04:10:03 -05:00
claude 0528d10081 autonomy phase 2.5 - tightening up some stuff in the pipeline 2025-12-15 01:56:57 -05:00
claude e2e55a0fda autonomy phase 2 2025-12-14 14:43:08 -05:00
claude ae41b51888 autonomy build, phase 1 2025-12-14 01:44:05 -05:00
claude 70e57ba5d2 cortex pipeline stablized, inner monologue is now determining user intent and tone 2025-12-13 04:13:12 -05:00
claude 7693bc4080 autonomy scaffold 2025-12-13 02:55:49 -05:00
claude 628edb681a v0.5.2 update
Dev
2025-12-12 08:04:20 +00:00
claude 58d6520056 v0.5.2 - fixed: llm router async, relay-UI mismatch, intake summarization failure, among others.
Memory relevance thresh. increased.
2025-12-12 02:58:23 -05:00
claude 77429ca6e0 v0.6.1 - reinstated UI, relay > cortex pipeline working 2025-12-11 16:28:25 -05:00
claude 67b7f9594c autonomy, initial scaffold 2025-12-11 13:12:44 -05:00
claude 875e660e31 docs updated for v0.5.1 2025-12-11 03:49:23 -05:00
claude 09b6b364e5 v0.5.1-Major cortex rework. clean up done too. Merge from dev
v0.5.1-Major cortex rework. clean up done too.
2025-12-11 03:48:29 -05:00
claude 832fea78d0 gitignore updated, to ignore vscode settings 2025-12-11 03:42:30 -05:00
claude 3b5ec9c974 cleaning up deprecated files 2025-12-11 03:40:47 -05:00
claude 3eb19d30f0 cortex rework continued. 2025-12-11 02:50:23 -05:00
claude 8428e5e04e deprecated old intake folder 2025-12-06 04:38:11 -05:00
claude 04f4ed6b51 intake/relay rewire 2025-12-06 04:32:42 -05:00
claude 03450b5f70 add. cleanup 2025-11-30 03:58:15 -05:00
claude 6312f2ae92 intake internalized by cortex, removed intake route in relay 2025-11-29 19:08:15 -05:00
claude 5db0614cdc cortex 0.2.... i think? 2025-11-29 05:14:32 -05:00
claude 26f5a6b972 fixed neomem URL request failure, now using correct variable 2025-11-28 19:50:53 -05:00
claude c3fffcdd80 context added, wired in. first attempt 2025-11-28 19:29:41 -05:00