* feat: codify queue columns
* fix: batch with python loop control
* fix: cleanup merge
* fix: down revision
* fix: batch delete in migration
* feat: only run alembic tests for changed migration / test (#264)
* feat: only run alembic tests for changed migration / test
* fix: Run full test suite if alembic testing infra changes
* feat: codify times_derived + level on Document (#260)
* feat: codify times_derived + level on Document
* fix: CR comment
* fix: CodeRabbit comments
* fix: batch migrations; move types; remove fields from payload
* fix: rm duplicate table args
* fix: add messages.id FK
* feat: fix race condition in message sequence batching
* fix: CodeRabbit comments; commit early to release the advisory lock before generating embeddings
* fix: use index + rm unused method
* fix: PR comments
* fix: bug in lock timeout
* fix: patch tracked_db for peers route within conftest.py
* fix: remove default max_distance from get_working_rep, get token count from gemini client properly, log summaries better
* fix: defensively get message public id (new field)
* fix: add defensive check to to_schema_summary
---------
Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
* feat: add optional JWT and webhook secrets to honcho instance creation
* chore: ignore spurious warnings
* feat: add response format if using gpt-5 model family
* feat: add response models to all apis except anthropic
* fix: raise NotImplementedError for response models in AsyncAnthropic client
* chore: address review
* [WIP] representation structure + deriver cleanup
* chore: add tests, cleanup
* feat: [WIP: semi-working] representation object
* fix: alignment
* fix: make observations hashable for dedup
* fix: datetime formatting, observation counting
* fix: switch to int for message id, clean up representation
* feat: remove need for metadata working rep
* chore: cleanup
* fix: use tenacity instead of custom fns
* feat: add representation and card to context if desired
* feat: add semantically relevant observations
* fix: pass all params to streaming, nonblocking streaming
* feat: consolidate document saving, make working representation fetching much smarter
* chore: add 100% test coverage of representation util
* feat: basic dream infra
* feat: dream queue item first pass
* chore: fixes & cleanup from coderabbit
* fix: dreams scheduled when new document count reaches a certain threshold
* feat: wip: timed dreams (not working)
* fix: test
* fix: remove useless pyright ignore
* fix: executing dreams
* feat: dreaming
* feat: [WIP] longmemeval bench
* feat: add USE_PEER_CARD setting, fix longmem test driver
* feat: get full working rep for dialectic in one swoop -- fix representation_from_documents to use the proper timestamp!
* fix: timestamps for real, handle assistant qs in longmem
* fix: remove old client, add batching to longmem
* perf: remove duplicate detection, will move to background task
* feat: track perf metrics on evals
* feat: adjust deriver prompt to use peer_id, add question date to question, clean up deriver
* fix: label metrics by task for better perf trace
* chore: code review
* feat: add efficiency score to longmem bench
* chore: tuning and cleaning up eval
* chore: bring in the big prompts
* feat: add support for vllm client
* feat: perf: bundle db calls in deriver and dialectic, increase max conns in docker db
* feat: add merge-sessions flag to longmemeval, add SUMMARY_ENABLED flag
* fix: COLLECT_METRICS default false
* chore: display start/end message ids, don't include in metrics
* fix: break large messages apart for eval
* fix: only get/create collection when needed
* feat: properly attribute documents with message id ranges and add session name column to documents
* fix: revert move of get_or_create_collection (need for fkey)
* fix: always get collection with peer name even if it's none
* chore: coderabbit
* fix: give peer card its own config, expand document schema, refactor get_context to be parallel, various cleanup chores and bugfixes
* chore: refactor: reify observer/observed system across entire codebase, including db migration
* refactor: cleanup code organization, make singletons where desired
* refactor: replace embeddings store with representation manager
* chore: coderabbit cleanup
* feat: multi-db longmem harness
* Merge branch 'main' into ben/multi-db-harness
* [WIP] feat: add delete workspace endpoint, use in bench
* chore: move excess logging to debug
feat: improve metrics block logs to include more data
fix: make longmem db deletion configurable
* fix: [CRITICAL] use async genai client
* chore: update core sdk, fix tests to use aio as well
* fix: rollback prompt changes
* chore: update version
* fix: cleanup, coderabbit, wrap delete op in try/except
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* feat: add optional JWT and webhook secrets to honcho instance creation
* chore: ignore spurious warnings
* feat: add response format if using gpt-5 model family
* feat: add response models to all apis except anthropic
* fix: raise NotImplementedError for response models in AsyncAnthropic client
* chore: address review
* [WIP] representation structure + deriver cleanup
* chore: add tests, cleanup
* feat: [WIP: semi-working] representation object
* fix: alignment
* fix: make observations hashable for dedup
* fix: datetime formatting, observation counting
* fix: switch to int for message id, clean up representation
* feat: remove need for metadata working rep
* chore: cleanup
* fix: use tenacity instead of custom fns
* feat: add representation and card to context if desired
* feat: add semantically relevant observations
* fix: pass all params to streaming, nonblocking streaming
* feat: consolidate document saving, make working representation fetching much smarter
* chore: add 100% test coverage of representation util
* feat: basic dream infra
* feat: dream queue item first pass
* chore: fixes & cleanup from coderabbit
* fix: dreams scheduled when new document count reaches a certain threshold
* feat: wip: timed dreams (not working)
* fix: test
* fix: remove useless pyright ignore
* fix: executing dreams
* feat: dreaming
* feat: [WIP] longmemeval bench
* feat: add USE_PEER_CARD setting, fix longmem test driver
* feat: get full working rep for dialectic in one swoop -- fix representation_from_documents to use the proper timestamp!
* fix: timestamps for real, handle assistant qs in longmem
* fix: remove old client, add batching to longmem
* perf: remove duplicate detection, will move to background task
* feat: track perf metrics on evals
* feat: adjust deriver prompt to use peer_id, add question date to question, clean up deriver
* fix: label metrics by task for better perf trace
* chore: code review
* feat: add efficiency score to longmem bench
* chore: tuning and cleaning up eval
* chore: bring in the big prompts
* feat: add support for vllm client
* feat: perf: bundle db calls in deriver and dialectic, increase max conns in docker db
* feat: [WIP] realtime context object
note: must download custom stainless API for SDK
* feat: add merge-sessions flag to longmemeval, add SUMMARY_ENABLED flag
* fix: COLLECT_METRICS default false
* chore: display start/end message ids, don't include in metrics
* fix: break large messages apart for eval
* fix: only get/create collection when needed
* feat: properly attribute documents with message id ranges and add session name column to documents
* fix: revert move of get_or_create_collection (need for fkey)
* fix: always get collection with peer name even if it's none
* chore: coderabbit
* fix: bug in get context
feat: get context updates in ts sdk
* feat: viz
* chore: update honcho-ai/core, remove WIPs
* fix: consistent ordering, comment nits, removed excess dreamer init
* fix: test int->str
* fix: Add validation and update async python client
* fix: add validation for last_user_message as well
* fix: add deeper validation to getContext in typescript sdk
* fix: let session context take a Message object for lastUserMessage to match python sdk behavior
* fix: use PeerIdSchema
* fix: allow peer object as argument
* fix: lastUserMessage min length 1
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* feat: add optional JWT and webhook secrets to honcho instance creation
* chore: ignore spurious warnings
* feat: add response format if using gpt-5 model family
* feat: add response models to all apis except anthropic
* fix: raise NotImplementedError for response models in AsyncAnthropic client
* chore: address review
* [WIP] representation structure + deriver cleanup
* chore: add tests, cleanup
* feat: [WIP: semi-working] representation object
* fix: alignment
* fix: make observations hashable for dedup
* fix: datetime formatting, observation counting
* fix: switch to int for message id, clean up representation
* feat: remove need for metadata working rep
* chore: cleanup
* fix: use tenacity instead of custom fns
* feat: add representation and card to context if desired
* feat: add semantically relevant observations
* fix: pass all params to streaming, nonblocking streaming
* feat: consolidate document saving, make working representation fetching much smarter
* chore: add 100% test coverage of representation util
* feat: basic dream infra
* feat: dream queue item first pass
* chore: fixes & cleanup from coderabbit
* fix: dreams scheduled when new document count reaches a certain threshold
* feat: wip: timed dreams (not working)
* fix: test
* fix: remove useless pyright ignore
* fix: executing dreams
* feat: dreaming
* feat: [WIP] longmemeval bench
* feat: add USE_PEER_CARD setting, fix longmem test driver
* feat: get full working rep for dialectic in one swoop -- fix representation_from_documents to use the proper timestamp!
* fix: timestamps for real, handle assistant qs in longmem
* fix: remove old client, add batching to longmem
* perf: remove duplicate detection, will move to background task
* feat: track perf metrics on evals
* feat: adjust deriver prompt to use peer_id, add question date to question, clean up deriver
* fix: label metrics by task for better perf trace
* chore: code review
* feat: add efficiency score to longmem bench
* chore: tuning and cleaning up eval
* chore: bring in the big prompts
* feat: add support for vllm client
* feat: perf: bundle db calls in deriver and dialectic, increase max conns in docker db
* feat: add merge-sessions flag to longmemeval, add SUMMARY_ENABLED flag
* fix: COLLECT_METRICS default false
* chore: display start/end message ids, don't include in metrics
* fix: break large messages apart for eval
* fix: only get/create collection when needed
* feat: properly attribute documents with message id ranges and add session name column to documents
* fix: revert move of get_or_create_collection (need for fkey)
* fix: always get collection with peer name even if it's none
* chore: coderabbit
* fix: give peer card its own config, expand document schema, refactor get_context to be parallel, various cleanup chores and bugfixes
* chore: refactor: reify observer/observed system across entire codebase, including db migration
* refactor: cleanup code organization, make singletons where desired
* refactor: replace embeddings store with representation manager
* chore: coderabbit cleanup
* chore: update migration to non-null session param in documents, general review and cleanup
* chore: merge branch 'main' into ben/deriver-tidy
* chore: review fixes
* feat: Modify the Summary BaseModel to use public_id of message rather than internal ID
* fix: fallback invocation
* fix: strict validation
* fix: rm ID from Message schema
* fix: make SDK changes
* feat: use token limit from all senders for rollup
* fix: send all messages to queue_manager
* test: fixe tests and move ownership check to separate query
* fix: if first sender message exceeds batch then we should return an empty batch
* feat: separate representation and non-representation processing
* fix: return msg object and queue items
* fix: rollup logic with interleaving messages
* fix: rm TODO
* Fix langfuse trace and add fallback for weird error in deriver
* fix: simplify query
* fix: comment out update_current_generation
* fix: BPR
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* fix: simplify; use debug logs
* fix: random type error
* fix: CR comments
* fix: move limit check before opening db connection
* fix: use single SQL call to verify ownership and fetch message batch
* fix: CR comments 2
* feat: add optional JWT and webhook secrets to honcho instance creation
* chore: ignore spurious warnings
* feat: add response format if using gpt-5 model family
* feat: add response models to all apis except anthropic
* fix: raise NotImplementedError for response models in AsyncAnthropic client
* chore: address review
* chore: add tests, cleanup
* fix: use tenacity instead of custom fns
* fix: pass all params to streaming, nonblocking streaming
* chore: fix test mock
- Updated `critical_analysis_call` and `critical_analysis_prompt` to include a new `peer_id` parameter for improved context in analysis.
- Modified the `CertaintyReasoner` class to pass the sender's name as `peer_id` during analysis calls.
- Adjusted test cases to reflect the inclusion of `peer_id`, ensuring comprehensive coverage of the new functionality.
* fix: refactor datetime handling in security and utility modules
- Updated `verify_jwt` function to utilize `parse_datetime_iso` for improved expiration time validation.
- Enhanced `_validate_datetime_string` to prioritize timezone-aware formats and streamline parsing logic.
- Modified `created_at` assignments in `ObservationContext` to use UTC timezone for consistency in timestamp handling.
* fix: proper observation extraction
- Replaced direct observation references with the `extract_observation_content` function to enhance clarity and maintainability in the `new_observations` list comprehension.
* refactor: streamline datetime parsing in filter and formatting utilities
- Removed redundant timezone-aware format handling from `_validate_datetime_string` in `filter.py`.
- Enhanced `parse_datetime_iso` in `formatting.py` to ensure consistent conversion of 'Z' suffix to timezone-aware datetime objects, improving clarity and functionality.
* refactor: update JWT verification and enhance datetime parsing
- Changed `verify_jwt` function from asynchronous to synchronous for improved performance and simplicity.
- Enhanced `parse_datetime_iso` to include comprehensive input validation and support for various timezone formats, ensuring consistent and secure datetime parsing.
* chore: coderabbit
* fix: long-held connections in queue manager
* fix: CR comments. tests
* fix (deriver): Limit # of work units claimed based on available workers
* fix: detached instance
* fix: batch claim work units
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* chore: fill out missing metadata inputs in python sdk
* feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage
* feat: zod
chore: update tests
chore: bump version, changelog
* chore: python sdk version bump and changelog
* [WIP] feat: combine search methods and rework endpoint to include limit param
* chore: test new stainless config with library
* nits: coderabbit
* Merge branch 'ben/sdk-improvements' into ben/search-rrf
* chore: pre-commit hooks cleanup
* feat: thoroughly document observation config
* Update sdks/python/src/honcho/peer.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: v1.3.0
* feat: update version to 2.2.0 and enhance search functionality with arbitrary filters
- Remove unused config variables
- Added arbitrary filters to all search endpoints.
- Pluralize `filters` everywhere in SDKs for consistency
- Updated documentation and changelog to reflect these changes.
* expose core client in TS and Python SDKs (#150)
* expose core client from sdks
* align text
* fix: resolve get_effective_observe me race condition, default peer config (#176)
* fix: resolve get_effective_observe me race condition, default peer config
* fix: preserve custom config even after leaving
* chore: test cases, enqueue types
* Update sdks/typescript/package.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
---------
Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: formatting
* chore: revert undesired changes to v1 spec, clean up docs, coderabbit
* feat: better search docs, fix worker.ts
* fix: correctly make ts params optional in cases, update docs
* chore: coderabbit
* chore: remove spurious package-lock
* feat: [WIP] introduce peer cards
* chore: remove search.mdx
* chore: clean up deriver
* feat: peer cards working in deriver
* feat: add basic peer_card_bench
* feat: refine peer card prompt, add mini-benchmark, switch to gpt-5-nano
* refactor: update peer card handling in dialectic functions and improve error handling
- Enhanced `get_peer_card` function to handle `ResourceNotFoundException`.
- Updated `dialectic_call` and `dialectic_stream` to accept `peer_card` and `target_peer_card` parameters.
- Modified prompt generation to include peer card information.
- Cleaned up whitespace in several files for consistency.
* chore: update mirascope dependency version in configuration files
- Bumped mirascope version from 1.25.1 to 1.25.5 in pyproject.toml and uv.lock.
- Added a note in config.py regarding peer card output token handling.
- Removed unnecessary comments in clients.py for clarity.
* fix: [coderabbit] improve error handling in set_peer_card and enhance logging
- Added a check in `set_peer_card` to raise `ResourceNotFoundException` if the peer does not exist.
- Updated logging in `CertaintyReasoner` to capture exceptions with Sentry when enabled.
- Refined logging messages for clarity and consistency across various functions.
- Cleaned up whitespace and formatting in several files for improved readability.
* refactor: update working representation handling and improve metadata key usage
- Introduced constants for representation collection names to enhance clarity and maintainability.
- Updated function signatures in `get_working_representation` and `set_working_representation` to require `session_name`.
- Simplified metadata key determination logic by using constants instead of hardcoded strings.
- Removed legacy fallback logic for working representation data retrieval.
- Refactored `save_working_representation_to_peer` to utilize the new `set_working_representation` function for improved code reuse.
* chore: update configuration files and enhance working representation settings
- Added new peer card settings and context token limits to `.env.template`, `config.toml.example`, and documentation.
- Introduced `WORKING_REPRESENTATION_MAX_OBSERVATIONS` to `DeriverSettings` for better control over observation storage.
- Updated `set_working_representation` to merge new observations while respecting the maximum limit.
- Improved docstrings for clarity and consistency across functions.
* feat: introduce LLMError exception and enhance error handling in deriver
- Added LLMError exception to handle failures in LLM calls, normalizing inputs into a JSON-serializable format.
- Updated CertaintyReasoner to raise LLMError on exceptions during LLM function calls.
- Enhanced QueueManager to log LLMError occurrences and re-queue messages appropriately.
- Modified test runner to support asynchronous operations and improved output formatting for test results.
- Updated test cases to include session information for better context.
* feat: add __repr__ method to QueueItem for improved string representation
- Implemented a __repr__ method in the QueueItem class to provide a clear and informative string representation of its attributes.
- Updated timeout handling in TestRunner to default to 10000.0 seconds when timeout_seconds is not set, enhancing robustness in polling operations.
* refactor: update peer card data structure and improve handling in related functions
- Changed return type of `get_peer_card` and `set_peer_card` to use `list[str]` instead of `str | None`.
- Updated `peer_card_call` and related functions to accommodate the new list structure for peer cards.
- Introduced `PeerCardQuery` model to standardize responses from peer card queries.
- Adjusted prompt generation in `peer_card_prompt` to reflect the new data structure.
- Modified benchmark tests to align with the updated peer card handling.
* refactor: adjust peer card output token settings and update related functions
- Increased `PEER_CARD_MAX_OUTPUT_TOKENS` from 2000 to 4000 in `DeriverSettings`.
- Updated `critical_analysis_call` to use `json_mode` and removed unused parameters.
- Modified benchmark tests to utilize the new `PEER_CARD_MAX_OUTPUT_TOKENS` setting.
- Removed obsolete `add_dislike.json` test file.
* refactor: update peer card handling in critical analysis and dialectic prompts
- Changed `peer_card` parameter type from `str | None` to `list[str] | None` in `critical_analysis_call` and related functions.
- Simplified error handling in `process_representation_task` by removing redundant try-except block.
- Updated prompt generation in `critical_analysis_prompt` and `dialectic_prompt` to format `peer_card` as a string with newlines.
- Adjusted benchmark tests to reflect changes in peer card structure and output formatting.
* refactor: update peer card test cases to use list structure
- Modified test cases in `test_representation_crud.py` to reflect the change in `peer_card` parameter type from `str` to `list[str]`.
- Updated assertions to accommodate the new list format for setting and retrieving peer cards.
- Ensured that tests for missing peers correctly handle the list input format.
* fix: improve formatting of peer card output in prompts
- Updated `peer_card_prompt` to join `old_peer_card` list elements with newlines for better readability.
- Removed outdated comment in `dialectic_prompt` regarding handling of non-existent cards.
* chore: [coderabbit] enhance docstring and logging in prompts and queue manager
- Updated the docstring in `critical_analysis_prompt` to provide detailed type annotations for parameters.
- Improved logging in `chat` to differentiate between single and multiple retrieved peer cards.
- Adjusted logging format in `QueueManager` to use a more structured approach for shutdown messages.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
* feat: add support for custom message timestamps in API
- Introduced `created_at` parameter for message creation, allowing users to specify custom timestamps.
- **Single source of truth for timestamp string format**
- Updated SDK documentation to reflect this new feature and its use cases.
- Enhanced validation schemas to include the optional `created_at` field.
- Added tests to verify functionality for messages with and without custom timestamps, ensuring correct behavior and default timestamp usage.
* feat: add timestamp option to sdks
* feat: Add get summaries endpoints
* feat: WIP basic SDK implementation blocked until stainless release
* feat: Implement SDKs with honcho-core methods
* fix (sdk): Used release 1.4.0 core sdks
* fix: Code Rabbit
* chore: Pytest errors
---------
Co-authored-by: Benjamin McCormick <docterformer@protonmail.com>
* feat: webhooks
* feat: Enhance webhook security and typing, fix validation and encryption bugs
* fix: lint / types
* fix: rm files
* fix: rm mcp
* fix: pydantic issue with TypedDict in python version <= 3.11
* fix: pre-commit hook for test coverage
* fix: simplify API -- store url on workspace
* fix: redo architecture
* fix: webhook body
* fix: make workspace optional
* fix: comments
* refactor: add webhook secret
* fix: CR comments
* feat: use deriver for webhooks
* use key-value approach
* feat: add work unit key to deriver
* fix: add work unit key to webhooks
* fix: tests
* fix: cr comments #2
* fix: endpoint structure; make webhook delivery into a function; add tests; other general comments
* chore: change webhook secret, fix test event and workspace_id, use async with
* feat: implement queue.empty and backfill
* fix: unique constraint
* refactor: queue to use outerjoin and remove skip locked; also fix publish queue.empty
* fix: tests
* fix: migration - make columns non-nullable
* feat: add complex arbitrary filtering on all objects
* fix: safe numeric casting and application of comparators
* fix: add way more tests, fix bugs with filter parsing
* chore: pass model_class as arugment to apply_filter
* fix: default to not caring about is_active in get_sessions_for_peer
* fix: address coderabbit complaints (valid)
* fix: throw filter errors when necessary, validate inputs and handle edge cases with more tests
* fix: remove all type errors and most type warnings
* fix: don't use db in tests that don't need it
cheat: sprinkle in some pyright: ignore in filter.py
* fix: allowlist for filtering -- no filtering by content, message id, or anything internal
* fix: handle mixed types in metadata, add tests
* chore: refine types
* chore: rename fiter param everywhere
* type stuff
* add action
* bump python
* Refactor type annotations and update tracking decorators in agent and dependencies modules. Replace ai_track with track from src.utils.types, and enhance type hints for better clarity. Update pyproject.toml to allow untyped libraries.
* type everything basically
* fix migration typing
* type like crazy
* remove usless tests
* Update mocks in tests to use AsyncMock for dialectic_call and dialectic_stream, ensuring proper async behavior in test cases. Adjust mock return values for consistency and clarity.
* Update src/deriver/tom/single_prompt.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update src/deriver/tom/long_term.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Enhance CLAUDE.md documentation with additional details on core concepts, API structure, and development commands. Update command syntax for running server and tests to use 'uv run' for consistency. Improve clarity in configuration and architectural decisions sections.
* Refactor type annotations in CRUD functions to accept more flexible filter types, changing from dict[str, str] to dict[str, Any]. Clean up logging in agent.py by removing unnecessary timing logs for user representation generation and query execution.
* Remove unused import of ai_track from long_term.py and single_prompt.py to clean up the codebase.
* pass tests
* update some stuff
* fix unused
* ruff
* make stuff work again
* Add LLM_GROQ_API_KEY to GitHub Actions and format tom_inference parameters
* test
* test
* Refactor LLM settings to use 'gemini' provider and update related model parameters; remove unused API keys from GitHub Actions workflow.
* Update LLM settings to use 'anthropic' provider and change model to 'claude-3-5-haiku-20241022'; maintain existing summarization provider.
* test
* llm provider stuff
* update
* revert
* Integrate client management for LLM providers across various modules; remove deprecated environment variable setup for API keys.
* only if key avaialble
* Refactor type hints and improve schema definitions for queue processing; remove unused imports and enhance function signatures for clarity.
* fix test
* model
* test
* Update LLM provider type annotations and enhance client management; replace Provider with Providers for better type handling in config and clients modules.
* Refactor LLM provider handling to default to "openai" for custom providers across multiple modules; update type annotations and improve client management for consistency.
---------
Co-authored-by: Dani Balcells <18307962+danibalcells@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Initial Model Changes
* fix migration
* update schemas
* handle router changes
* make name FK and corresponding crud changes
* fix routers
* comment metamessage references
* add bulk peer session operations
* update messages router
* fix require_auth to make app runnable
* remove peer from get messages
* add new routes
* implement new crud methods for session peers
* alter keys router
* add feature flags dict and token limit + fix SessionContext
* fix: paginate get_session_peers and make tokens/summary query params in get_session_context
* feat: add create_messages_for_peer, get_messages_for_peer
* fix: make session_peers a Table
* finalize upgrade
* fix: working migration
* fixes: schemas, crud, routes
* add token count
* fix migration errors discovered from db with data in it
* fixes: unify with sdk
* downgrade
* feat: swap jwts to new paradigm
* fix unit tests
* fix tests pt 2
* fix: handle foreign key errors in create_messages
* fix downgrade
* downgrade queue changes
* feat: add search to resources, make get_messages handle limits, add get_representation to peer
* chore: beef up tests
* fix: move chat and rep params to post body, add target to get_representation
* fix get_user_protected_collection and embedding store
* feat: add peer config to models, crud, schemas, routes
* fix: update tests and fix list(tuple()) to dict()
* add session peer left_at/joined_at and modify enqueue
* [wip]: feat: refactor history to match new paradigm and implement get_context
* fix messages enqueue and test it
* chore: align deriver and new honcho paradigm
* chore: update consumer
* chore: get rid of is_user
* feat: change queue tables to new key strat
* fix: convert queue session_id to str properly
* fix downgrade migration
* feat: re-integrate old deriver
* chore: coderabbit review, lots of small bug fixes
* fix: fix batch migration of messages and token count
* fix: mock ModelClient
* CodeRabbit comments
* CR comments 2
* fix: handle metadata and feature flags properly in get_or_creates
* cr comments 3
* feature flag to configuration
* feat: add real get crud
* fix: remove reverse param from places it does not belong
* add session.name constraint; narrow task type; disable deriver from configuration
* get_or_add_peers_to_session + session peers limit
* feat: get deriver status for peer, optional session param
* fix: add internal_metadata, fix agent
* rename to get_deriver_status, simplify
* fix: move working rep into crud get/set, unstub get_working_representation
* fix: don't payload metadata
* peer protected collection -> global / local rep collections
* Simplify control flow, use session_name vs id
* coderabbit syntax errors
* coderabbit changes
* ruff formatting
* Revert non-src changes from ruff formatting
* move status endpoint into workspace, protects session_name, peer is optional
* fix: optimize db query for deriver status
* chore: add tests for queue status endpoint, add some extra validation in endpoint, reduce post-processing
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
Co-authored-by: Benjamin McCormick <docterformer@protonmail.com>
Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com>
* feat (storage): Remove strict requirement for body on list endpoints
* fix (storage): Rename metamessage_type to label with backwards compatability
* fix (schemas): Backwards compatability for metamessage_type and idiomatic schemas
* fix (docs): Update docs to reference label instead of metamessage type
* fix (storage): Rebase db migration and fix tests
* chore: alembic consistency
* chore: Update versioning for release
* fix: remove db creation at start and sync migrations and models
* fix: Checkpoint changing metamessage schema
* chore: linter fixes
* fix: session cloning working
* Hybrid long-term memory (#92)
* Add TOM method switching
* Add system prompt and note on format
* Add persistence tweaks
* Specify format for each section of user representation
* Parse XML tags before saving representation metamessage
* Clean up
* Use Claude 3.5 Haiku and refine prompt
* Simplify message processing
* chore: update token limit on dialectic and model for deriver
* Add embedding-based long-term fact retrieval
* Fix bug preventing new documents from being created
* Use multiple queries + tweak prompt
* Fix collection name bug + add duplicate removal
* First implementation of on-demand user rep generation
* WIP debug on-demand user rep changes
* Fixed representations not being stored & deriver issue
* Some speed improvements
* Play with number of facts / queries
* WIP prompt caching for Claude
* WIP fix anthropic caching
* Anthropic prompt caching working but messages too short
* Use Cerebras for small inferences
* Make dialectic responses 1000 tokens max
* Make user representation generation model a constant
* Use llama 3.1 8b for query generation
* Update env template
* Add crud.get_or_create_protected_collection
* rabbit comments
* Fix linter issues
* Add Cerebras to stream router method
* Better handling of default-empty string args
* Change prints to debug logs
* Add error handling to TOM inference
* Handle missing/empty client in model responses
* Handle no messages case in get_chat_history
* Fix indent
* Add error handling to single_prompt methods
* Fix get_or_create_user_protected_collection
* Simplify openAI-compatible model client instantiation
* Remove health endpoint
* Remove LocalEmbeddingStore
* Change prints to debug logs
* Change sentry track
* Code review changes
* Add README to ToM module
* Switch to Groq
* Fix inconsistent openai compatible provider list in stream()
* Update env template to include Groq variables
* Add model_client tests
* fix: Fix unit tests
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* add scoped API keys (#91)
* add AUTH_JWT_SECRET and ADMIN_KEY, use in security middleware (TODO granular keys)
* WIP: convert all API paths to use scoped keys
* add basic unit tests for API keys, ruff formatting
* MVP of route using JWT for payload
* add get_user_from_token
* add key table to postgres, use it to enable key revocation
* add key revocation pt 2 -- fix order of param checks
* finish convenience routes that assume params from JWT
* add tests for key API
* get_keys
* add secrets utility script, add key rotation, fill out tests
* add tiny cache as PoC
* nits, validations, etc
* only create keys table migration if necessary
* fix keys tests to always use auth
* tiny fix to make custom DATABASE_SCHEMA work
* review: add better docs, fix security issue with cache, clear db on rotation, and more
* remove rotation
* remove key database entirely
* Add `/all` path to get all apps (#94)
* add `/all` path for apps
* assert vector extension installed (need this for groudon)
* review
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* add scoped API keys (#91)
* add AUTH_JWT_SECRET and ADMIN_KEY, use in security middleware (TODO granular keys)
* WIP: convert all API paths to use scoped keys
* add basic unit tests for API keys, ruff formatting
* MVP of route using JWT for payload
* add get_user_from_token
* add key table to postgres, use it to enable key revocation
* add key revocation pt 2 -- fix order of param checks
* finish convenience routes that assume params from JWT
* add tests for key API
* get_keys
* add secrets utility script, add key rotation, fill out tests
* add tiny cache as PoC
* nits, validations, etc
* only create keys table migration if necessary
* fix keys tests to always use auth
* tiny fix to make custom DATABASE_SCHEMA work
* review: add better docs, fix security issue with cache, clear db on rotation, and more
* remove rotation
* remove key database entirely
* Add `/all` path to get all apps (#94)
* add `/all` path for apps
* assert vector extension installed (need this for groudon)
* review
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* chore: README and CHANGELOG updates
* add JWT expiry
* fix: Consolidate get methods with JWT token resolution
* chore: Add Annotation to Path, Query, and Body params
* chore: run ruff formatter
* chore: nits & add one exhaustive test of a query route
* fix: undo change to fly.toml
* fix: Langfuse tracing
* Consolidate Get Methods (#96)
* fix: Consolidate get methods with JWT token resolution
* chore: Add Annotation to Path, Query, and Body params
* chore: run ruff formatter
* chore: nits & add one exhaustive test of a query route
* fix: undo change to fly.toml
---------
Co-authored-by: dr-frmr <docterformer@protonmail.com>
* fix: dev-667 fix streaming endpoint
* fix: Anthropic Langfuse Tracing
* fix: add scripts folder to dockerfile
* fix: Remove redundant fields from pydantic schemas
* fix: Add deeper protection on reserved collection
* fix: Consolidate chat and stream methods
* docs: Update Mintlify API Reference and Changelog
* remove langchain guide, update architecture diagram
* honcho mcp server
* chore: Update .env template
* update discord, temporarily remove other guides
* Limit dialectic & deriver context usage with two-scale progressive summarization (#97)
* WIP two tiered summaries
* Move to process_item
* Save user rep metamessage even if no message_id
* Change number of messages per short summary
* Fix broken mock
* Remove prints
* chore: fix test
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* feat: Add Gemini Support, link facts to message, use 8b for dialectic fact queries
* chore: Styling
* chore: coderabbit nitpicks
* keep dialectic guide
* Add streaming guide
* Remove TODO from dialectic guide
* Fix JS snippets that referred to honcho singleton as client
* Add App explanation to architecture page
---------
Co-authored-by: Dani Balcells <18307962+danibalcells@users.noreply.github.com>
Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com>
Co-authored-by: dr-frmr <docterformer@protonmail.com>
Co-authored-by: vintro <vince@plasticlabs.ai>
Co-authored-by: Daniel Balcells <dbalcells@gmail.com>
* Add TOM method switching
* Add system prompt and note on format
* Specify format for each section of user representation
* Clean up
* Use Claude 3.5 Haiku and refine prompt
* chore: update token limit on dialectic and model for deriver
* chore: Remove healthcheck endpoint
* feat: Fix inconsistent error handling
* fix: remove SQL echo for performance and increase dialectic to 300 tokens on stream
* chore: Update CLAUDE.md
* fix: Update Dialectic 3.7 Sonnet and add to Changelog
* chore: Update Version Number
---------
Co-authored-by: Daniel Balcells <dbalcells@gmail.com>
* fix: increase db pool limit and optimize crud requests
* fix: Sentry tracing and fly concurrency
* feat: Add alembic and indexes
* feat: Batch insert method
* fix: Pydantic Validation
* fix: Added Pydantic based API validation and Associated Test Cases
* chore: Update Changelog
* fix(docs): Update Docs with new API Method and OpenAPI Spec
* chore(ci): Add Environment Variable for Anthropic
* fix(storage) Remove Prepared Statements to make compatible with Supavisor
* fix(deriver and dialectic) Use latest user level user_represenation
* fix(storage) Switch to text columns for best postgres practices
* fix(storage) Update docstrings and document query method
* chore(release) v0.0.14 Release State
* chore(release) CHANGELOG
* fix(deriver) Add more detailed profiling with sentry
* chore(release) CHANGELOG
* fix(deriver) increase retry limit on anthropic
* feat(storage) Add a route to clone sessions
* fix(storage) Add additional test case and fix case conventions for query parameters in clone method
* fix(storage) make case conventions consistent and documentation updates
* fix(docs) Update docs with newest routes
* fix(storage) Add commit to clone method
* fix: remove opentelemtry code and make deriver workers configurable
* feat(storage) change get route for messages and metamessages to use POST for options
* feat(storage) Change remaining paginated gets to POST requests with options
* ready to test deriver
* prompts ready for testing
* compare entire list, don't loop through facts one by one
* parse xml, batch process ai query docs
* timing works
* session id is writing to csv now
* ignore timing logs
* infinite backrooms-inpsired prompts
* yousim/ib inspired prompts v0
* accept incoming changes on agent.py
* dialectic to sonnet for now
* remove timing, use py-spy
* cleanup from timing removal
* remove extra timing stuff
* Route for User LeveL Metamessages
* functional state
* chore: Clean up artifacts
* fix(deriver) update database calls for new schema and payload
* chore(docs) Update Honcho Version
---------
Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
* fix(embedding) use base openai for embedding and remove azure
* feat(models) switch to nanoids with internal and public id system
* feat(pydantic) Updates models and routes to get tests passing
* fix(deriver) fix enqueue method
* Perf Testing Utilities
* feat(ci) Add github action with github service container
* chore(ci) Change hostname for service container
* chore(ci) Add Trust Flag
* chore(ci) Use Defaults
* readability
* Try to use localhost
* chore(ci) Use non-default database
* Try with default credentials but non-standard db
* Try to ignore pwd
* feat(dialectic) Allow for batch questions and load session history
* feat(dialectic) parallelize facts and history queries
* feat(agent) Addresses dev-258 allow specifying additional collections
* feat(uv) switched from poetry to uv
* feat(deriver) Turn off derivations by editing session medatadata with a deriver_disabled flag
* fix(tests) Clean up test logic
---------
Co-authored-by: Vineeth Voruganti <vineeth@macbook-pro.mynetworksettings.com>
* fix(storage) Remove location_id
* feat(deriver) Deriver can process multiple sessions at once and uses rich for prints
* fix(route) collection update error handling
* chore(docs) update openapi and version numbers
* chore: Save Point
* fix(db): change connection logic and remove unnecessary refreshes
* fix(documents): switch to Azure embedding model
* feat: Setup pytest fixtures
* feat(tests): Initial test routes for tranche 1
* feat(test) tranche 2 of tests and associated bug fixes
* feat(test) tranche 3 of tests and associated bug fixes
* fix(tests) Address PR comments and update version and changelog