Commit Graph

116 Commits

Author SHA1 Message Date
amysguan
47b0c87ebe Add modes self and self_sliding_window for prompt caching (#9372)
* add self compaction method with proper caching (pass in tools, don't refresh sys prompt beforehand) + sliding fallback

* updated prompts for self compaction

* add tests for self, self_sliding_window modes and w/o refresh messages before compaction

* add cache logging to summarization

* better handling to prevent agent from continuing convo on self modes

* if mode changes via summarize endpoint, will use default prompt for the new mode

---------

Co-authored-by: Amy Guan <amy@letta.com>
2026-02-24 10:55:26 -08:00
Kevin Lin
bd5b5fa9f3 feat(gemini): add 3.1 pro preview support (#9553)
Add 3.1 model metadata for Google AI and update Gemini tests/examples to use the new handle.

👾 Generated with [Letta Code](https://letta.com)

Co-authored-by: Letta <noreply@letta.com>
2026-02-24 10:55:11 -08:00
Ari Webb
d0e25ae471 feat: add glm 5 to core (#9436)
* feat: add glm 5 to core

* test glm 5
2026-02-24 10:52:07 -08:00
Sarah Wooders
50a60c1393 feat: git smart HTTP for agent memory repos (#9257)
* feat(core): add git-backed memory repos and block manager

Introduce a GCS-backed git repository per agent as the source of truth for core
memory blocks. Add a GitEnabledBlockManager that writes block updates to git and
syncs values back into Postgres as a cache.

Default newly-created memory repos to the `main` branch.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* feat(core): serve memory repos over git smart HTTP

Run dulwich's WSGI HTTPGitApplication on a local sidecar port and proxy
/v1/git/* through FastAPI to support git clone/fetch/push directly against
GCS-backed memory repos.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): create memory repos on demand and stabilize git HTTP

- Ensure MemoryRepoManager creates the git repo on first write (instead of 500ing)
  and avoids rewriting history by only auto-creating on FileNotFoundError.
- Simplify dulwich-thread async execution and auto-create empty repos on first
  git clone.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): make dulwich optional for CI installs

Guard dulwich imports in the git smart HTTP router so the core server can boot
(and CI tests can run) without installing the memory-repo extra.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): guard git HTTP WSGI init when dulwich missing

Avoid instantiating dulwich's HTTPGitApplication at import time when dulwich
isn't installed (common in CI installs).

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): avoid masking send_message errors in finally

Initialize `result` before the agent loop so error paths (e.g. approval
validation) don't raise UnboundLocalError in the run-tracking finally block.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): stop event loop watchdog on FastAPI shutdown

Ensure the EventLoopWatchdog thread is stopped during FastAPI lifespan
shutdown to avoid daemon threads logging during interpreter teardown (seen in CI
unit tests).

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* chore(core): remove send_*_message_to_agent from SyncServer

Drop send_message_to_agent and send_group_message_to_agent from SyncServer and
route internal fire-and-forget messaging through send_messages helpers instead.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): backfill git memory repo when tag added

When an agent is updated to include the git-memory-enabled tag, ensure the
git-backed memory repo is created and initialized from the agent's current
blocks. Also support configuring the memory repo object store via
LETTA_OBJECT_STORE_URI.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): preserve block tags on git-enabled updates

When updating a block for a git-memory-enabled agent, keep block tags in sync
with PostgreSQL (tags are not currently stored in the git repo).

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* chore(core): remove git-state legacy shims

- Rename optional dependency extra from memory-repo to git-state
- Drop legacy object-store env aliases and unused region config
- Simplify memory repo metadata to a single canonical format
- Remove unused repo-cache invalidation helper

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix(core): keep PR scope for git-backed blocks

- Revert unrelated change in fire-and-forget multi-agent send helper
- Route agent block updates-by-label through injected block manager only when needed

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

---------

Co-authored-by: Letta <noreply@letta.com>
2026-02-24 10:52:06 -08:00
github-actions[bot]
81398118dd fix: add validation for per_file_view_window_char_limit to prevent int32 overflow (#8937)
The per_file_view_window_char_limit column is defined as INTEGER (32-bit)
in PostgreSQL. Without API-level validation, users could pass values
exceeding int32 max (2,147,483,647), causing database errors.

Changes:
- Added MAX_INT32, MAX_PER_FILE_VIEW_WINDOW_CHAR_LIMIT, and
  MAX_FILES_OPEN_LIMIT constants
- Added field validators to CreateAgent and UpdateAgent schemas to
  enforce these limits

Fixes #8936

🤖 Generated with [Letta Code](https://letta.com)

Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com>
Co-authored-by: datadog-official[bot] <datadog-official[bot]@users.noreply.github.com>
2026-02-24 10:52:05 -08:00
Ari Webb
9ce1249738 feat: openrouter byok (#9148)
* feat: openrouter byok

* new client is unnecessary

* revert json diffs
2026-01-29 12:44:04 -08:00
Ari Webb
2233d141b1 feat: add codex 5.2 context window (#8704) 2026-01-19 15:54:39 -08:00
Ari Webb
6d859174c2 feat: make conversations throw http busy to stop race condition [LET-6842] (#8411)
* feat: make conversations throw http busy to stop race condition

* use redis lock instead

* move acquire lock into redis client, integration tests, move lock release into run manager

* fix tests, bug

* conditional import

* remove else

* better release

* run ci

* final reordering lock

* update tests

* wrong naming of lock holder token
2026-01-12 10:57:49 -08:00
Ari Webb
02f3e3f3b9 fix: fix providers and models persistence (#8302) 2026-01-12 10:57:48 -08:00
Ari Webb
e47eb23522 fix: max output tokens for gemini 3 models (#7322) 2025-12-17 17:31:03 -08:00
Kevin Lin
857139f907 feat: Set reasonable defaults for max output tokens [LET-6483] (#7084) 2025-12-17 17:31:02 -08:00
Ari Webb
4d90f37f50 feat: add gpt-5.2 support (#6698) 2025-12-15 12:02:34 -08:00
Kevin Lin
1ca9df0626 feat: Add memory_apply_patch to base tools (#6491)
add memory apply patch
2025-12-15 12:02:34 -08:00
Charles Packer
d3f4d00113 feat(core): add support for gpt-5.1-codex-max (#6528) 2025-12-15 12:02:33 -08:00
Sarah Wooders
86023db9b1 feat: get rid of client injection in args and just make it always available (#6459) 2025-12-15 12:02:19 -08:00
Sarah Wooders
f417e53638 fix: fix cancellation issues without making too many changes to message_ids persistence (#6442) 2025-12-15 12:02:19 -08:00
Sarah Wooders
ceadacd30e feat: support programmatic tool execution (cloud only) (#6441) 2025-12-15 12:02:19 -08:00
Charles Packer
efb5a87313 fix(core): remove threshold multiplier on summ trigger which is bug prone (#6447) 2025-12-15 12:02:19 -08:00
Sarah Wooders
0a0cf391fc fix: fix client injection code (#6421) 2025-12-15 12:02:18 -08:00
Ari Webb
7380eaec13 feat: enable gpt5.1 models [LET-6178] (#6175)
* hack at gpt51

* revert package lock

* first hack

* default context window

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-24 19:09:33 -08:00
jnjpng
099da97e7b fix: remove modal image creation logging and fix base imports (#6197)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:09:32 -08:00
Sarah Wooders
5730f69ecf feat: modal tool execution - NO FEATURE FLAGS USES MODAL [LET-4357] (#5120)
* initial commit

* add delay to deploy

* fix tests

* add tests

* passing tests

* cleanup

* and use modal

* working on modal

* gate on tool metadata

* agent state

* cleanup

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-13 15:36:56 -08:00
Ari Webb
da11d80bf4 fix: add default model gpt4.1 (#5897)
add default model gpt4.1

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:39 -08:00
Sarah Wooders
57bb051ea4 feat: add tool return truncation to summarization as a fallback [LET-5970] (#5859) 2025-11-13 15:36:30 -08:00
Charles Packer
60ed435727 fix(core): patch summarizer on letta_agent_v3.py (letta_agent_v1 loop) (#5863)
* fix(core): patch summarizer

* fix: misc fixes

* refactor: remove fallbacks, instead throw a warning

* refactor: pull out magic number to constant
2025-11-13 15:36:20 -08:00
Kian Jones
c4c9d12f42 fix: hotfix hardcode context windows to prevent gemini model listing rate limiting (#5731)
hotfix lol
2025-10-24 15:14:31 -07:00
Kevin Lin
35b5383724 feat: match line number rendering to Anthropic / OAI defaults (#5492) 2025-10-24 15:13:15 -07:00
Matthew Zhou
de7011e4de feat: Mark certain internal tools as safe to execute concurrently [LET-5614] (#5553)
* Change execution pattern depending on

* Increase efficiency

* Mark certain tools as parallel safe
2025-10-24 15:12:26 -07:00
Kian Jones
4bbd760204 feat: add validation to fastapi routes for agent IDs (#5454)
* change my PR to match Caren's

* add path parameter validation for agent id first

* remove old import

* remove old agent_id_pattern pattern

* add example and fix max/min calculation to include hyphen

* fix regex string interpolation

* example deprecated in favour of examples

* openapi autogen

* change template test to expect 422

* fix 422 swallow

* expect 422 or 400

* rewrite  error codes

* fix hallucinated uuid

* tweaked error message test

* print docker logs on failure
2025-10-24 15:12:11 -07:00
Charles Packer
d45d29a03f feat: add gpt-5-codex support (#5194)
* feat(core): add gpt-5-codex

* feat(web): add support to the web hardcoding
2025-10-07 17:50:49 -07:00
Sarah Wooders
e07a589796 chore: rm composio (#5151) 2025-10-07 17:50:49 -07:00
Sarah Wooders
6016ac0f33 chore: undo fetch_webpage rename (#5132) 2025-10-07 17:50:49 -07:00
Charles Packer
09b173668a feat(core): rename fetch_webpage to web_fetch (#5110) 2025-10-07 17:50:48 -07:00
Kevin Lin
09d9c3ffd4 feat: anthropic tools for claude sonnet 4.5 (#4988)
* add anthropic memory tools

* memory view working

* update memory examples

* tools

* feat: some changes (#5003)

* feat: added the ability to modify and add descriptions on creation

* fix: kill dead code & write into core_tool_executor instead

* fix: use block_manager not agent_manager where possible, also turn the return string errors into raising exceptions

* fix: cleanup, get rid of more return string errors replaced with valueerror, also drop deadcode

---------

Co-authored-by: Charles Packer <packercharles@gmail.com>
2025-10-07 17:50:47 -07:00
Kian Jones
b8e9a80d93 merge this (#4759)
* wait I forgot to comit locally

* cp the entire core directory and then rm the .git subdir
2025-09-17 15:47:40 -07:00
Kian Jones
22f70ca07c chore: officially migrate to submodule (#4502)
* remove apps/core and apps/fern

* fix precommit

* add submodule updates in workflows

* submodule

* remove core tests

* update core revision

* Add submodules: true to all GitHub workflows

- Ensure all workflows can access git submodules
- Add submodules support to deployment, test, and CI workflows
- Fix YAML syntax issues in workflow files

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* remove core-lint

* upgrade core with latest main of oss

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 12:45:53 -07:00
Charles Packer
388dd46ffc feat: various performance patches for gpt-5 [LET-4157] (#4381)
* feat: increase the verbosity of the heartbeat kwarg

* chore: strip docstrings out from the file in which they are not parsed (duplicates inside base.py

* feat: add examples to the docstrings for memory_replace and memory_insert

* feat: add more examples
2025-09-06 11:23:13 -07:00
Charles Packer
dd1a9a0b7c fix: reduce the default tool return to something more sane [LET-4180] (#4383)
fix: reduce the default tool return to something more sane (prev limit was allowing like 200k tokens to come through and crash gpt-5
2025-09-03 13:51:33 -07:00
Matthew Zhou
129dd97902 feat: Add fetch webpage tool [LET-4188] (#4395)
* Add fetch webpage tool

* Use trafilatura for web extraction
2025-09-03 13:34:35 -07:00
Matthew Zhou
6e633bd8f9 feat: Change namespace to be org scoped and filter on agent_id [LET-4163] (#4368)
* Change to org scoped and agent_id filtering

* Finish modifying conversation search tool

* Fix failing tests

* Get rid of bad imports
2025-09-03 10:00:19 -07:00
Charles Packer
361c50bce4 fix: patch context window of gpt-5 to 272k not 400k [LET-4177] (#4379)
fix: patch context window of gpt-5 to 272k not 400k
2025-09-02 21:10:40 -07:00
Sarah Wooders
891da984a6 fix: fix various ease of use problems (#3934)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-08-15 00:07:12 -07:00
cthomas
aab41cdb76 feat: add agent id input validation in retrieve endpoint (#3892) 2025-08-13 14:03:05 -07:00
Charles Packer
c02bff1e9b fix: patch gpt-5 max context window in constants (#3843) 2025-08-10 14:55:22 -07:00
Matthew Zhou
76c9a58d6f feat: Support streaming and move endpoint for letta-free (#3780) 2025-08-06 15:33:35 -07:00
Kevin Lin
ec04ca99f7 feat: exclude stronger models from default base tool rules (#3703)
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2025-08-05 20:33:05 +00:00
Matthew Zhou
e62ddf8355 feat: Add per-agent file management controls with context-aware defaults (#3467) 2025-07-22 10:43:37 -07:00
Matthew Zhou
33d99be157 feat: Add env var to control model within builtin web_search tool (#3417) 2025-07-18 16:45:59 -07:00
Matthew Zhou
d0d67d8b9b feat: Throttle pinecone uploads (#3373) 2025-07-16 20:29:08 -07:00
Matthew Zhou
da17351ca4 feat: Add throttling and retries for pinecone (#3302) 2025-07-14 10:30:49 -07:00