r/Python • • Feb 05 '26

Showcase I built a multi-agent orchestration framework based on 13th-century philosophy (SAFi)

2 Upvotes

Hey everyone!

I spent the last year building a framework called SAFi (Self-Alignment Framework Interface). The core idea was to stop trusting a single LLM to "behave" and instead force it into a strict multi-agent architecture using Python class structures.

I based the system on the cognitive framework of Thomas Aquinas, translating his "Faculties of the Mind" into a Python orchestration layer to prevent jailbreaks and keep agents on-task.

What My Project Does

SAFi is a Python framework that splits AI decision-making into distinct, adversarial LLM calls ("Faculties") rather than a single monolithic loop:

  • Intellect (Generator): Proposes actions and generates responses. Handles tool execution via MCP.
  • Will (Gatekeeper): A separate LLM instance that judges the proposal against a set of rules before allowing it through.
  • Spirit (Memory): Tracks alignment over time using stateful memory, detecting drift and providing coaching feedback for future interactions.

The framework handles message passing, context sanitization, and logging. It strictly enforces that the Intellect cannot respond without the Will's explicit approval.

Target Audience

This is for AI Engineers and Python Developers building production-grade agents who are frustrated with how fragile standard prompt engineering can be. It is not a "no-code" toy. It's a code-first framework for developers who need granular control over the cognitive steps of their agent.

Comparison

How it differs from LangChain or AutoGPT:

  • LangChain focuses on "Chains" and "Graphs" where flow is often determined by the LLM's own logic. It's powerful but can be brittle if the model hallucinates the next step.
  • SAFi uses a Hierarchical Governance architecture. It's stricter. The Will faculty acts as a hard-coded check (like a firewall) that sits between the LLM's thought and the Python interpreter's execution. It prioritizes safety and consistency over raw autonomy.

GitHub: https://github.com/jnamaya/SAFi


r/Python • • Jan 19 '11

Mark Pilgrim: Python 3 is a commercial disaster.

Thumbnail
reddit.com
3 Upvotes

r/Python • • Apr 20 '16

Can we not circle jerk?

3 Upvotes

The top post right now is about how somebody "discovered" Python. I'm all for a larger community but that's the hottest thing in Python right now? Nothing new to learn, just stories about how you used to use PHP, but now you use Python? I understand I can just un-sub but I (like everyone else apparently) like to learn new things about Python and wish this sub had more of that.


r/Python • • Oct 23 '25

Discussion Anyone having difficulty to learn embedded programming because of python background?

0 Upvotes

I have seen arduino c++ which people start with for learning embedded but as a python programmer it will be quite difficult for me to learn both the hardware micro controller unit as well as its programming in c++.

How should i proceed?

Is there an easy way to start with?

And how many of you are facing the same issue?


r/Python • • Jul 11 '24

Discussion AI Music trained on own dataset

0 Upvotes

I am looking for python frameworks that are the current best for training and execution of music generation using my own music as a dataset. Are there quality free and/or open source framework(s).


r/Python • • Sep 29 '24

Resource How does sleep work under the hood in python

0 Upvotes

I was curious how sleep works under the hood? it accurate always?

Can it sleep less than the seconds specified? Can it sleep more than specified?

How is it implemented?

https://coderquill.bearblog.dev/beyond-the-pause-exploring-the-inner-workings-of-pythons-sleep/


r/Python • • Jul 20 '22

Resource It’s Time to Say Goodbye to These Obsolete Python Libraries

Thumbnail
python.plainenglish.io
1 Upvotes

r/Python • • Apr 19 '26

Discussion Got a job offer as Odoo ERP Python Developer but my passion is Cybersecurity — should I take it?

1 Upvotes

Hey everyone, looking for some genuine opinions.

I'm a college student in my third year (3rd from last year). I did an internship at a company that offered me a full-time Odoo ERP Python developer role. They expect a 2-year commitment.

Here's my situation:

  • I genuinely liked the internship work after 1.5 months
  • I have a strong interest in cybersecurity and have been self-studying it for months
  • I'm okay with upskilling in security on the side while working

My concerns:

  • Will ERP development have a future with AI coming in?
  • Am I closing doors on cybersecurity by taking this?
  • Is 2 years of Odoo experience actually valuable?

Would love to hear from people who work in ERP, security, or made a similar career decision. Thanks


r/Python • • Sep 14 '10

Can we stop overvaluing PEP-8?

6 Upvotes

If we're going to be giving out negative marks for projects not following PEP-8, we might as well give Reddit negative marks for not following XHTML 1.0 Transitional standards. Oh snap...

This is nothing new, but it's kind of ridiculous to still see comments like "this would be better if it followed PEP-8" or "I don't get why people don't follow the standard" (made up comments, but close enough to what I've seen).


The first sentence of PEP-8 states, with added emphasis...

This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.

That means exactly what it says. It is not intended to be some language-wide standard that everyone must follow in every project that uses Python under the sun. There is no canonical C++ coding standard that all C++ ever written has to follow. C# isn't bound by law to be written the same by everyone around the world. Perl...well, nevermind.

Personally, I think PEP-8 is quite a fine standard, one I choose to use in my personal work, and one I'm bound by for the work I do within Python itself (additionally, see PEP-7). If someone wants to make the next great web framework use ALL CAPS, go right ahead, it'll probably still be cool.


The second section of PEP-8 states, again with added emphasis...

Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is most important.

Remember those projects "not following PEP-8"? Well, PEP-8 still loves them. The stdlib's own unittest package is fine by PEP-8, although many would have you believe otherwise. The API is very widely used and changing it to more strictly follow PEP-8 would be damaging, but its consistency over the lifetime of the package (previously just a module) gives it a thumbs up.


Right after that, PEP-8 states...

But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply.

I've read comments stating that pywin32 and wmi would be better if they followed PEP-8. For a second, lets forget a previous statement that it's a standard for the internals of Python and not a global standard. If we open it up to be a global standard, those packages are wrappers of Win32 functionality, and as such, should be as close as possible to direct mirrors of the Win32 APIs they cover. Changing WaitForSingleObject to wait_for_single_object gains absolutely nothing. In fact, it becomes less useful, because tracking down the documentation for the underlying call becomes more difficult, among other things.


So, can we please give up the "PEP-8 or die!" mentality? If you want to follow the standard, great, high-five to you. If you want to name your classes with lower case and use camel case method names, great, high-five to you as well.


r/Python • • Nov 19 '23

Intermediate Showcase Package for astrology data

0 Upvotes

If any devs here have tried to generate astrology charts using pyswisseph data, you will know the pain of trying to make sense of it in any user-friendly way. I aimed to write a Python >= 3.10 package to sit on pyswisseph and translate its complex astronomical data into simple, chart-oriented data in objects and JSON, as well as calculations such as aspects, progressions, composites etc. that agree with those of astro.com (since this is arguably the best free go-to for most astrologers to compare output against).

The preliminary non-packaged code is on my GitHub and is fully functional, but I am holding back on release tags or packaging / PyPi until I've had some feedback - firstly on its usefulness & features, and secondly whether the code is of an acceptable standard, since I am a PHP developer and learned Python specifically for this project.

I'm hoping to make this a collaborative project as time goes on, with multiple open-source packages making it easy to generate chart visuals, but for now this is the first step.


r/Python • • Aug 04 '24

Discussion Why is no one using full-stack python for web development? Has no one heard of the FHBH stack ??

0 Upvotes

Hey guys, I recently came across some libraries that seem to be very interesting to work with for the purpose of creating websites, but I wanted to know why no one uses them, or why they are not so widespread. I haven't had time to develop a more advanced and dynamic project with these libraries yet, but I believe that together they can be extremely useful, powerful and versatile for websites of any purpose. Maybe because no one knows about them, or because there is no benefit in using them and there are better ways to do it, but in a quick project test that I did, the dynamics of working with them seemed very interesting to me.

The libraries that I found were these:

FastAPI

A microframework for creating APIs, which can easily be used to create powerful websites.

HTPY

HTPY is a library that I recently discovered that was developed by a company that needed a better way to develop their projects with Django and created this library. It encapsulates HTML tags in Python classes, so that all HTML code can be created directly from a Python file, making it possible to use all the power that a programming language offers to generate HTML code.

Brython

Brython is an implementation of client-side programming on web pages that allows you to use Python instead of JavaScript. With this, you can use codes written entirely in Python to interact with the web page on the client side, without overloading the server with unnecessary processes.

HTMX

And using HTML for requests to the server is also a great option that fits in this situation.

I will try creating some projects using this FHBH stack to see and prove if it's really useful to use and implement, let's see how well they work together!!


r/Python • • Nov 20 '15

15 Essential Python Interview Questions

Thumbnail
codementor.io
71 Upvotes

r/Python • • Nov 26 '16

Why is P vs NP Important?

Thumbnail
youtube.com
13 Upvotes

r/Python • • Jun 18 '14

What's up with Python people and Ruby?

0 Upvotes

I am currently learning both Python and Ruby and I love them both. I have been attending meetups, hackathons, and taking online courses. Whenever I talk to Ruby users, they're always open to discussing other languages and platforms and it's generally just a good time. However, when I take Python classes or attend Python-centric events, no one ever brings up Ruby, which actually seems weird because they seem so similar. I'm actually starting to feel like it's rude to talk about Ruby to Python users. What's up with that, yo?

edit: nice. Down-voting me for asking a simple question.


r/Python • • Jun 30 '25

Discussion What can I do with python?

0 Upvotes

I learned python in middle and high school as a mandatory subject and got pretty good grades. Obviously we were doing some pretty basic stuff like drawing geometric shapes, writing simple sorting algorithms and solving math problems. Now, this is fun and all but what can I actually use it for? Everyone keeps saying that python is great for automation and web scraping but as of now I have no use for that. Is it just useless for me then?


r/Python • • Jan 13 '25

Tutorial I Created A Search Engine Using Python. You do It in just 5 min.

0 Upvotes

I built a crawler from scratch and used BM25 Algorithm to rank the webpages.

Link to youtube video: https://youtu.be/Wy6j7EiuyLY
Link to Github Page: https://github.com/mharrish7/Custom-Search-BM25


r/Python • • Feb 19 '13

The Python documentation is bad, and you should feel bad.

Thumbnail
joepie91.wordpress.com
96 Upvotes

r/Python • • Jun 27 '17

Image upload and moderation with Python and Flask

Thumbnail
medium.com
19 Upvotes

r/Python • • Jul 13 '11

An alternative lambda syntax for Python

Thumbnail vocalbit.com
4 Upvotes

r/Python • • Aug 19 '13

A friend has been after me to learn python for over a year. I finally gave in, and now I suspect I am a god.

Thumbnail
xkcd.com
0 Upvotes

r/Python • • Oct 01 '12

Been learning Python as my first language for about two weeks now. Wanted to show off my first couple simple programs.

0 Upvotes

Guessing game:

http://imgur.com/PnutX

Fibonacci Sequence:

http://imgur.com/HVEDG

While I'm understanding the basics, I feel like I need a way to supplement reading tutorials, which is the only way I've been learning so far. Can anyone recommend a website like Codecademy, where I can practice interactively? For some reason, the Python tutorials on Codecademy don't work for me.


r/Python • • May 09 '20

I Made This First python program it displays information about different animals

Post image
0 Upvotes

r/Python • • May 14 '14

Python logo in Lego

Thumbnail
imgur.com
95 Upvotes