Skip to content

Conversation

@codecrack3
Copy link

@codecrack3 codecrack3 commented Nov 5, 2025

I find this project quite interesting in terms of ideas, but I realize that the current Rust agentfs source code has some issues (some syscall Lseek don't exist), I just fixed it, but have not committed it in the same PR. I’ve created a separate branch and completed a few things, and I think it’s entirely possible to fork this project into a version that fully uses Python bindings to create a filesystem, interact with Python, and provide a suitable layer for use in other agent frameworks. However, for now, it’s just an idea, and this is a quick implementation of my Python SDK.

Kai Nguyen added 8 commits November 5, 2025 10:14
@codecrack3 codecrack3 mentioned this pull request Nov 5, 2025
@penberg penberg changed the title Python sdk implementation Python SDK implementation Nov 5, 2025
@penberg
Copy link
Collaborator

penberg commented Nov 12, 2025

Hey @codecrack3, sorry for taking such a long time to get to this. The plan is to use the pyturso crate like we use Turso for everything else because it will allow us to optimize and special-case when possible. Also, there's the question of whether this Python API should be sync or async. The TypeScript SDK, for example, mimics the Node filesystem APIs and I think that's what the Python one should do too.

@codecrack3
Copy link
Author

Thank you for replying to me. I agree with your plan, and using Pycrate is a great and reliable idea. And about the async problem that means we need to support both synchronous and asynchronous usage in the Python SDK, right? I think that’s a good approach, and I might try implementing it. I’m just wondering whether we should simply add synchronous functions and use asyncio to convert async functions into sync ones. What do you think about this solution?

@penberg
Copy link
Collaborator

penberg commented Nov 22, 2025

Hey @codecrack3, I have not heard anyone ask for sync API so far so I think it's fine to just have the async one. I do want to replace the aiosqlite package with Turso one, but we need to implement that upstream first. Should not be too hard to do.

Replace aiosqlite with libsql (Turso's official Python bindings) for SQLite operations.

Changes:
- Add turso_async.py wrapper with dedicated thread pattern for async support
- Update KvStore, Filesystem, ToolCalls to use new async wrapper
- Remove ON DELETE CASCADE (not supported by Turso/Limbo)
- Add manual cascade deletes in delete_file()
- Update all test fixtures to use turso_async.connect()

All 21 tests pass, no threading warnings.
@codecrack3
Copy link
Author

Hello @penberg , I just migrated from aiosqlite to libsql. Libsql is really cool and easy to use. If there’s anything else in the SDK I should look at, please let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants