Commit Graph

17 Commits

Author SHA1 Message Date
doria d332321138
chore: update api routes to /v2 (#138)
* chore: update api routes to /v2

* chore: undo erroneous uv.lock update

* chore: update openapi.json
2025-06-24 10:45:55 -04:00
doria 657feacc53
Migrate to Peer Paradigm (#131)
* 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

* fix: add internal_metadata, fix agent

* fix: move working rep into crud get/set, unstub get_working_representation

* fix: don't payload metadata

* peer protected collection -> global / local rep collections

* fix: remove spurious mockery

* feat: add english language search index

* fix: remove spurious error

* chore: 2.0.0 -- update readme, changelog, claude.md

* chore: update readme for peer paradigm

---------

Co-authored-by: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com>
Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
2025-06-19 11:41:39 -04:00
Vineeth Voruganti 1b54b4703b
Make JSON body optional for list endpoints and Rename Metamessage Type to Label (#108)
* 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
2025-05-14 16:19:30 -04:00
Rajat Ahuja d0285189c3
Add LRU Cache + Add App_Id / User_Id to resource tables (#107)
* init LRU cache

* update schemas

* fix tests

* fix sql queries

* make user_id/app_id nullable

* add migration

* enhance migration and change query in agent.py

* make cache asyncio safe

* add index to migrations and add utils

* fix fkey naming convention

* coderabbit comments

* remove remaining joins from crud and agent

* fix test
2025-05-14 15:50:24 -04:00
Vineeth Voruganti 8588d36eb4
v1.0.0 Release Candidate (#95)
* 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>
2025-04-10 13:59:40 -04:00
Vineeth Voruganti c2a50241cc
Fix Inconsistent Error Handling (#90)
* 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>
2025-03-05 09:44:49 -05:00
Vineeth Voruganti d6194df824
Bulk Message Creation Endpoint (#82)
* 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
2024-12-16 01:27:15 -05:00
Vineeth Voruganti 76085724e0
Release v0.0.14 (#78)
* 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
2024-11-15 12:38:02 -05:00
Vineeth Voruganti 17ff3804ec
v0.0.13 Ability to Clone Sessions (#77)
* 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
2024-11-07 12:10:09 -05:00
Vineeth Voruganti 1af4539d03
Honcho v0.0.12 Release (#74)
* fix(API): Basic API Versioning

* fix (docs) update docs with the latest API Specs

* chore: CHANGELOG

* chore: linting
2024-10-21 18:03:19 -04:00
Vineeth Voruganti 86bdd0cecf
Refactor Paginated GETs for better UX (#73)
* 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
2024-10-18 19:33:57 -04:00
vintro 487ec43362
Anthropic Migration (#72)
* 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>
2024-10-17 23:39:23 -04:00
Vineeth Voruganti 6d5439a4d8
Switch from UUIDv4 to NanoID (#71)
* 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
2024-10-17 14:07:51 -04:00
Vineeth Voruganti e553a871f7
Github Actions for Testing (#69)
* 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
2024-09-14 21:33:04 -04:00
Vineeth Voruganti 25229921c6
Dialectic Endpoint Improvements (#67)
* 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>
2024-09-14 17:06:11 -04:00
Vineeth Voruganti 1e40778338
[0.0.11] Release (#64)
* 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
2024-08-01 15:14:11 -04:00
Vineeth Voruganti ddcde6bcea
[0.0.10] Release
* 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
2024-07-25 13:45:27 -04:00