SynLrn – Modular Multi-Stage Learning for AI (No Naming or Structure Restrictions)
Overview
SynLrn is a production-ready, modular system for context-based learning memory and retrieval—designed for any AI or agent workflow. SynLrn supports any number of custom learning stages, adapts to your data, and makes context recall fast and simple—no naming, schema, or vendor constraints.
Highlights:
- Any learning stages you want: Use any stage names or workflow steps (thinking, clarifying, etc.)
- No format restrictions: Structure your learned data and knowledge base how you want.
- No external server: Everything runs locally, uses fast SQLite and RapidFuzz.
- Plug-in knowledge base: Start empty or preload with your own examples.
- Works with all frameworks: Use SynLrn in any Python project, agent, or LLM pipeline.
Why SynLrn?
Traditional “memory” frameworks force you to:
- Use their schema, stage names, or folder structures.
- Fit your workflow to their definitions.
- Often require a server, specific model, or fixed APIs.
SynLrn:
- Lets you define your own learning flow—no hard-coded stage names, no schema lock-in.
- Loads any data, any way: Add, group, and recall examples however you want.
- Keeps you in control: Your workflow, your code, your memory.
Key Features
- Flexible stage loading: Use any number of workflow stages.
- Pluggable knowledge base: Point to your own Python modules or classes.
- Context-based retrieval: RapidFuzz for fast, fuzzy example recall.
- Low token use: Matches and retrievals use minimal tokens, ideal for LLMs instead of providing full examples. in one shot SynLrn retrieves relevant examples based on context.
- Minimal, direct API: No setup bloat or function call ceremony.
Example Layout (ALL valid)
project_root/
├── SLKnowledgebase/
│ └── Knowledgebase.py # Your example base (optional)
├── .env
├── app.py
└── ...
Or any layout you prefer—no requirements.
How It Works
- You define your workflow stages.
- Store and retrieve context/response examples per stage, for any purpose.
- Recall examples by context (with fallbacks if needed).
Example Usage
from SynLrn import SynLrn
stages = [
"thinking", "clarifying", "gathering",
"defining", "refining", "reflecting", "decision"
]
fallbacks = {
"thinking": [
"user:\nWhat can you do?\n\nassistant:\nI can help with a wide variety of tasks, including..."
]
}
learn = SynLrn(stages=stages, fallbacks=fallbacks)
# Add a new memory/example
learn.addToLearned("thinking", "How do you work?", "I process your requests by reasoning over ...")
# Retrieve similar examples
results = learn.retrieveStage("How do you work?", "thinking")
for entry in results:
print(entry)
See full code and more examples on GitHub.
Customization
-
Knowledge base: Optionally preload with your own class/module, any structure, any naming—SynLrn will find your example data automatically.
-
Fallbacks: Pass a dict or a callable for custom fallback responses per stage.
-
Storage: All learning is stored locally (SQLite, configurable directory).
FAQ
Q: Do I have to follow any naming or folder structure? A: No. Use any stage names, directory layout, or file names you want.
Q: Can I use this in any Python agent, RAG, or LLM workflow? A: Yes.
Q: Do I need a server, or does SynLrn require a specific cloud provider? A: No. Everything is local, pure Python.
Code Examples
You can find code examples on my GitHub repository.
License
This project is licensed under the Apache License, Version 2.0. Copyright 2025 Tristan McBride Sr.
Acknowledgements
Project by:
- Tristan McBride Sr.
- Sybil
Metadata
Release files for SynLrn 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| synlrn-0.1.1.tar.gz | 12.6 kB | Without provenance | Details for synlrn-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| synlrn-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for synlrn-0.1.1-py3-none-any.whl |
Total release size: 22.8 kB
Release files / synlrn-0.1.1.tar.gz
| Download URL | synlrn-0.1.1.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6d14430682bb72930717c1d0300a2aef5718592885b742442d733bfa00c5c5f
|
|
BLAKE2b-256 checksum How to use checksums |
3266929b2f5872e0be623c60d72e8c1b7ab17d23ad416dbe16164da6c1512d14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / synlrn-0.1.1-py3-none-any.whl
| Download URL | synlrn-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6696bf436f674eb6bc5f63a947339b21a5e0920146199aa881890c94d2c3fe7
|
|
BLAKE2b-256 checksum How to use checksums |
f76d800934fdf82a23f62704b539b226c5cab1a4c1489d080277ab005298fcf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Security for SynLrn 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.