synapsekit 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- synapsekit-0.5.0/.github/DISCUSSION_TEMPLATE/ideas.yml +22 -0
- synapsekit-0.5.0/.github/ISSUE_TEMPLATE/bug_report.yml +81 -0
- synapsekit-0.5.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
- synapsekit-0.5.0/.github/ISSUE_TEMPLATE/feature_request.yml +52 -0
- synapsekit-0.5.0/.github/PULL_REQUEST_TEMPLATE.md +36 -0
- synapsekit-0.5.0/.github/profile/README.md +57 -0
- synapsekit-0.5.0/.github/workflows/ci.yml +41 -0
- synapsekit-0.5.0/.gitignore +71 -0
- synapsekit-0.5.0/.pre-commit-config.yaml +21 -0
- synapsekit-0.5.0/CHANGELOG.md +107 -0
- synapsekit-0.5.0/CODE_OF_CONDUCT.md +35 -0
- synapsekit-0.5.0/CONTRIBUTING.md +199 -0
- synapsekit-0.5.0/LICENSE +21 -0
- synapsekit-0.5.0/Makefile +26 -0
- synapsekit-0.5.0/PKG-INFO +268 -0
- synapsekit-0.5.0/README.md +195 -0
- synapsekit-0.5.0/ROADMAP.md +153 -0
- synapsekit-0.5.0/SECURITY.md +29 -0
- synapsekit-0.5.0/assets/banner.svg +63 -0
- synapsekit-0.5.0/assets/favicon.svg +14 -0
- synapsekit-0.5.0/assets/logo.svg +13 -0
- synapsekit-0.5.0/pyproject.toml +148 -0
- synapsekit-0.5.0/src/synapsekit/__init__.py +158 -0
- synapsekit-0.5.0/src/synapsekit/_compat.py +29 -0
- synapsekit-0.5.0/src/synapsekit/agents/__init__.py +33 -0
- synapsekit-0.5.0/src/synapsekit/agents/base.py +58 -0
- synapsekit-0.5.0/src/synapsekit/agents/executor.py +83 -0
- synapsekit-0.5.0/src/synapsekit/agents/function_calling.py +123 -0
- synapsekit-0.5.0/src/synapsekit/agents/memory.py +47 -0
- synapsekit-0.5.0/src/synapsekit/agents/react.py +147 -0
- synapsekit-0.5.0/src/synapsekit/agents/registry.py +42 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/__init__.py +13 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/calculator.py +72 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/file_read.py +42 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/python_repl.py +55 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/sql_query.py +106 -0
- synapsekit-0.5.0/src/synapsekit/agents/tools/web_search.py +59 -0
- synapsekit-0.5.0/src/synapsekit/embeddings/__init__.py +3 -0
- synapsekit-0.5.0/src/synapsekit/embeddings/backend.py +44 -0
- synapsekit-0.5.0/src/synapsekit/graph/__init__.py +26 -0
- synapsekit-0.5.0/src/synapsekit/graph/checkpointers/__init__.py +9 -0
- synapsekit-0.5.0/src/synapsekit/graph/checkpointers/base.py +23 -0
- synapsekit-0.5.0/src/synapsekit/graph/checkpointers/memory.py +26 -0
- synapsekit-0.5.0/src/synapsekit/graph/checkpointers/sqlite.py +41 -0
- synapsekit-0.5.0/src/synapsekit/graph/compiled.py +164 -0
- synapsekit-0.5.0/src/synapsekit/graph/edge.py +22 -0
- synapsekit-0.5.0/src/synapsekit/graph/errors.py +9 -0
- synapsekit-0.5.0/src/synapsekit/graph/graph.py +125 -0
- synapsekit-0.5.0/src/synapsekit/graph/mermaid.py +31 -0
- synapsekit-0.5.0/src/synapsekit/graph/node.py +34 -0
- synapsekit-0.5.0/src/synapsekit/graph/state.py +9 -0
- synapsekit-0.5.0/src/synapsekit/llm/__init__.py +34 -0
- synapsekit-0.5.0/src/synapsekit/llm/_cache.py +52 -0
- synapsekit-0.5.0/src/synapsekit/llm/_retry.py +44 -0
- synapsekit-0.5.0/src/synapsekit/llm/anthropic.py +125 -0
- synapsekit-0.5.0/src/synapsekit/llm/base.py +158 -0
- synapsekit-0.5.0/src/synapsekit/llm/bedrock.py +97 -0
- synapsekit-0.5.0/src/synapsekit/llm/cohere.py +45 -0
- synapsekit-0.5.0/src/synapsekit/llm/gemini.py +123 -0
- synapsekit-0.5.0/src/synapsekit/llm/mistral.py +74 -0
- synapsekit-0.5.0/src/synapsekit/llm/ollama.py +46 -0
- synapsekit-0.5.0/src/synapsekit/llm/openai.py +95 -0
- synapsekit-0.5.0/src/synapsekit/loaders/__init__.py +34 -0
- synapsekit-0.5.0/src/synapsekit/loaders/base.py +9 -0
- synapsekit-0.5.0/src/synapsekit/loaders/csv.py +35 -0
- synapsekit-0.5.0/src/synapsekit/loaders/directory.py +57 -0
- synapsekit-0.5.0/src/synapsekit/loaders/html.py +23 -0
- synapsekit-0.5.0/src/synapsekit/loaders/json_loader.py +38 -0
- synapsekit-0.5.0/src/synapsekit/loaders/pdf.py +23 -0
- synapsekit-0.5.0/src/synapsekit/loaders/text.py +31 -0
- synapsekit-0.5.0/src/synapsekit/loaders/web.py +44 -0
- synapsekit-0.5.0/src/synapsekit/memory/__init__.py +3 -0
- synapsekit-0.5.0/src/synapsekit/memory/conversation.py +38 -0
- synapsekit-0.5.0/src/synapsekit/observability/__init__.py +3 -0
- synapsekit-0.5.0/src/synapsekit/observability/tracer.py +70 -0
- synapsekit-0.5.0/src/synapsekit/parsers/__init__.py +5 -0
- synapsekit-0.5.0/src/synapsekit/parsers/json_parser.py +26 -0
- synapsekit-0.5.0/src/synapsekit/parsers/list_parser.py +16 -0
- synapsekit-0.5.0/src/synapsekit/parsers/pydantic_parser.py +23 -0
- synapsekit-0.5.0/src/synapsekit/prompts/__init__.py +3 -0
- synapsekit-0.5.0/src/synapsekit/prompts/template.py +45 -0
- synapsekit-0.5.0/src/synapsekit/py.typed +0 -0
- synapsekit-0.5.0/src/synapsekit/rag/__init__.py +4 -0
- synapsekit-0.5.0/src/synapsekit/rag/facade.py +187 -0
- synapsekit-0.5.0/src/synapsekit/rag/pipeline.py +98 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/__init__.py +5 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/base.py +23 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/chroma.py +68 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/faiss.py +72 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/pinecone.py +53 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/qdrant.py +76 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/retriever.py +65 -0
- synapsekit-0.5.0/src/synapsekit/retrieval/vectorstore.py +83 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/__init__.py +13 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/base.py +12 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/character.py +63 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/recursive.py +68 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/semantic.py +73 -0
- synapsekit-0.5.0/src/synapsekit/text_splitters/token.py +33 -0
- synapsekit-0.5.0/tests/__init__.py +0 -0
- synapsekit-0.5.0/tests/agents/__init__.py +0 -0
- synapsekit-0.5.0/tests/agents/test_executor.py +150 -0
- synapsekit-0.5.0/tests/agents/test_function_calling.py +155 -0
- synapsekit-0.5.0/tests/agents/test_memory.py +77 -0
- synapsekit-0.5.0/tests/agents/test_react.py +177 -0
- synapsekit-0.5.0/tests/agents/test_tools.py +320 -0
- synapsekit-0.5.0/tests/conftest.py +1 -0
- synapsekit-0.5.0/tests/graph/__init__.py +0 -0
- synapsekit-0.5.0/tests/graph/test_build.py +148 -0
- synapsekit-0.5.0/tests/graph/test_checkpointing.py +212 -0
- synapsekit-0.5.0/tests/graph/test_cycles.py +127 -0
- synapsekit-0.5.0/tests/graph/test_mermaid.py +80 -0
- synapsekit-0.5.0/tests/graph/test_run.py +209 -0
- synapsekit-0.5.0/tests/graph/test_state.py +35 -0
- synapsekit-0.5.0/tests/graph/test_stream.py +130 -0
- synapsekit-0.5.0/tests/llm/__init__.py +0 -0
- synapsekit-0.5.0/tests/llm/test_cache_retry.py +225 -0
- synapsekit-0.5.0/tests/llm/test_function_calling_providers.py +180 -0
- synapsekit-0.5.0/tests/llm/test_llm.py +155 -0
- synapsekit-0.5.0/tests/llm/test_providers.py +293 -0
- synapsekit-0.5.0/tests/loaders/__init__.py +0 -0
- synapsekit-0.5.0/tests/loaders/test_loaders.py +316 -0
- synapsekit-0.5.0/tests/memory/__init__.py +0 -0
- synapsekit-0.5.0/tests/memory/test_memory.py +54 -0
- synapsekit-0.5.0/tests/observability/__init__.py +0 -0
- synapsekit-0.5.0/tests/observability/test_tracer.py +66 -0
- synapsekit-0.5.0/tests/parsers/__init__.py +0 -0
- synapsekit-0.5.0/tests/parsers/test_parsers.py +128 -0
- synapsekit-0.5.0/tests/prompts/__init__.py +0 -0
- synapsekit-0.5.0/tests/prompts/test_prompts.py +130 -0
- synapsekit-0.5.0/tests/rag/__init__.py +0 -0
- synapsekit-0.5.0/tests/rag/test_facade.py +103 -0
- synapsekit-0.5.0/tests/rag/test_pipeline.py +99 -0
- synapsekit-0.5.0/tests/retrieval/__init__.py +0 -0
- synapsekit-0.5.0/tests/retrieval/test_backends.py +337 -0
- synapsekit-0.5.0/tests/retrieval/test_retriever.py +65 -0
- synapsekit-0.5.0/tests/retrieval/test_vectorstore.py +90 -0
- synapsekit-0.5.0/tests/text_splitters/__init__.py +0 -0
- synapsekit-0.5.0/tests/text_splitters/test_splitters.py +173 -0
- synapsekit-0.5.0/uv.lock +2999 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
labels: ["idea"]
|
|
2
|
+
body:
|
|
3
|
+
- type: markdown
|
|
4
|
+
attributes:
|
|
5
|
+
value: |
|
|
6
|
+
Share your ideas for SynapseKit — new features, integrations, design changes. No idea is too small.
|
|
7
|
+
|
|
8
|
+
- type: textarea
|
|
9
|
+
id: idea
|
|
10
|
+
attributes:
|
|
11
|
+
label: The idea
|
|
12
|
+
description: Describe your idea.
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: motivation
|
|
18
|
+
attributes:
|
|
19
|
+
label: Why?
|
|
20
|
+
description: What would this enable that isn't possible today?
|
|
21
|
+
validations:
|
|
22
|
+
required: false
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Something isn't working as expected
|
|
3
|
+
labels: ["bug", "triage"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thank you for taking the time to report a bug. Please fill in as much detail as possible.
|
|
9
|
+
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: What happened?
|
|
14
|
+
description: A clear and concise description of the bug.
|
|
15
|
+
placeholder: "When I call rag.ask_sync(), it raises ..."
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: reproduction
|
|
21
|
+
attributes:
|
|
22
|
+
label: Minimal reproduction
|
|
23
|
+
description: The smallest code snippet that reproduces the issue.
|
|
24
|
+
render: python
|
|
25
|
+
placeholder: |
|
|
26
|
+
from synapsekit import RAG
|
|
27
|
+
|
|
28
|
+
rag = RAG(model="gpt-4o-mini", api_key="sk-...")
|
|
29
|
+
# ...
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: expected
|
|
35
|
+
attributes:
|
|
36
|
+
label: Expected behaviour
|
|
37
|
+
description: What did you expect to happen?
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
|
|
41
|
+
- type: textarea
|
|
42
|
+
id: actual
|
|
43
|
+
attributes:
|
|
44
|
+
label: Actual behaviour
|
|
45
|
+
description: What actually happened? Include the full traceback if applicable.
|
|
46
|
+
render: shell
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- type: input
|
|
51
|
+
id: version
|
|
52
|
+
attributes:
|
|
53
|
+
label: SynapseKit version
|
|
54
|
+
placeholder: "0.4.0"
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
57
|
+
|
|
58
|
+
- type: input
|
|
59
|
+
id: python
|
|
60
|
+
attributes:
|
|
61
|
+
label: Python version
|
|
62
|
+
placeholder: "3.14.2"
|
|
63
|
+
validations:
|
|
64
|
+
required: true
|
|
65
|
+
|
|
66
|
+
- type: input
|
|
67
|
+
id: os
|
|
68
|
+
attributes:
|
|
69
|
+
label: Operating system
|
|
70
|
+
placeholder: "macOS 15.3 / Ubuntu 24.04 / Windows 11"
|
|
71
|
+
validations:
|
|
72
|
+
required: false
|
|
73
|
+
|
|
74
|
+
- type: textarea
|
|
75
|
+
id: extras
|
|
76
|
+
attributes:
|
|
77
|
+
label: Installed extras
|
|
78
|
+
description: Which optional packages are installed? (e.g. openai, anthropic, chroma)
|
|
79
|
+
placeholder: "synapsekit[openai,chroma]"
|
|
80
|
+
validations:
|
|
81
|
+
required: false
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Question or Discussion
|
|
4
|
+
url: https://github.com/SynapseKit/SynapseKit/discussions
|
|
5
|
+
about: Ask questions and share ideas in Discussions
|
|
6
|
+
- name: Documentation
|
|
7
|
+
url: https://synapsekit.github.io/synapsekit-docs/
|
|
8
|
+
about: Read the full documentation
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new feature or improvement
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Have an idea? We'd love to hear it. Before opening, please check if a similar request already exists.
|
|
9
|
+
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: What problem does this solve?
|
|
14
|
+
description: Describe the problem or limitation you're running into.
|
|
15
|
+
placeholder: "I'm building a pipeline where I need to... but currently I have to..."
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: solution
|
|
21
|
+
attributes:
|
|
22
|
+
label: Proposed solution
|
|
23
|
+
description: What would you like to see? Include a code sketch if helpful.
|
|
24
|
+
render: python
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: alternatives
|
|
30
|
+
attributes:
|
|
31
|
+
label: Alternatives considered
|
|
32
|
+
description: Any other approaches you've thought about or tried?
|
|
33
|
+
validations:
|
|
34
|
+
required: false
|
|
35
|
+
|
|
36
|
+
- type: dropdown
|
|
37
|
+
id: area
|
|
38
|
+
attributes:
|
|
39
|
+
label: Area
|
|
40
|
+
options:
|
|
41
|
+
- RAG / Pipeline
|
|
42
|
+
- Agents
|
|
43
|
+
- Graph Workflows
|
|
44
|
+
- LLM Provider
|
|
45
|
+
- Vector Store
|
|
46
|
+
- Loaders
|
|
47
|
+
- Output Parsers
|
|
48
|
+
- Prompt Templates
|
|
49
|
+
- Observability
|
|
50
|
+
- Other
|
|
51
|
+
validations:
|
|
52
|
+
required: true
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR do? 1-3 sentences. -->
|
|
4
|
+
|
|
5
|
+
Closes #<!-- issue number -->
|
|
6
|
+
|
|
7
|
+
## Type of change
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix
|
|
10
|
+
- [ ] New feature
|
|
11
|
+
- [ ] Documentation update
|
|
12
|
+
- [ ] Refactor / internal improvement
|
|
13
|
+
- [ ] Dependency / tooling update
|
|
14
|
+
|
|
15
|
+
## Changes
|
|
16
|
+
|
|
17
|
+
<!-- List the key changes made. -->
|
|
18
|
+
|
|
19
|
+
-
|
|
20
|
+
-
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
|
|
24
|
+
- [ ] All existing tests pass (`uv run pytest tests/ -q`)
|
|
25
|
+
- [ ] New tests added for new behaviour
|
|
26
|
+
- [ ] No API keys or secrets in the code
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
- [ ] Docstrings updated (if public API changed)
|
|
31
|
+
- [ ] [synapsekit-docs](https://github.com/SynapseKit/synapsekit-docs) updated (if new feature)
|
|
32
|
+
- [ ] CHANGELOG.md updated
|
|
33
|
+
|
|
34
|
+
## Notes for reviewer
|
|
35
|
+
|
|
36
|
+
<!-- Anything the reviewer should pay particular attention to? -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/SynapseKit/SynapseKit/main/assets/banner.svg" alt="SynapseKit" width="100%"/>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/synapsekit/)
|
|
8
|
+
[](https://www.python.org/)
|
|
9
|
+
[](https://github.com/SynapseKit/SynapseKit/blob/main/LICENSE)
|
|
10
|
+
[]()
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
**SynapseKit** is an async-native Python framework for building production-grade LLM applications — RAG pipelines, tool-using agents, and graph workflows — with a clean, minimal API.
|
|
17
|
+
|
|
18
|
+
Built streaming-first from day one. Two hard dependencies. Every abstraction is transparent, composable, and replaceable.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### What's inside
|
|
23
|
+
|
|
24
|
+
| | |
|
|
25
|
+
|---|---|
|
|
26
|
+
| **RAG Pipelines** | Streaming retrieval-augmented generation with 5 text splitters, 7+ document loaders, BM25 reranking, conversation memory |
|
|
27
|
+
| **Agents** | ReAct and native function calling (OpenAI, Anthropic, Gemini, Mistral). 5 built-in tools, fully extensible |
|
|
28
|
+
| **Graph Workflows** | Async DAG pipelines with parallel execution, conditional routing, cycle support, checkpointing, Mermaid export |
|
|
29
|
+
| **9 LLM Providers** | OpenAI, Anthropic, Ollama, Gemini, Cohere, Mistral, Bedrock — one interface, swap without rewriting |
|
|
30
|
+
| **5 Vector Stores** | InMemory, ChromaDB, FAISS, Qdrant, Pinecone — all behind `VectorStore` ABC |
|
|
31
|
+
| **LLM Caching & Retries** | LRU response caching and exponential backoff — opt-in, zero behavior change by default |
|
|
32
|
+
|
|
33
|
+
### Quick start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from synapsekit import RAG
|
|
37
|
+
|
|
38
|
+
rag = RAG(model="gpt-4o-mini", api_key="sk-...")
|
|
39
|
+
rag.add("Your document text here")
|
|
40
|
+
|
|
41
|
+
async for token in rag.stream("What is the main topic?"):
|
|
42
|
+
print(token, end="", flush=True)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Links
|
|
46
|
+
|
|
47
|
+
- [Documentation](https://synapsekit.github.io/synapsekit-docs/)
|
|
48
|
+
- [Quickstart](https://synapsekit.github.io/synapsekit-docs/docs/getting-started/quickstart)
|
|
49
|
+
- [API Reference](https://synapsekit.github.io/synapsekit-docs/docs/api/llm)
|
|
50
|
+
- [Changelog](https://github.com/SynapseKit/SynapseKit/blob/main/CHANGELOG.md)
|
|
51
|
+
- [Roadmap](https://synapsekit.github.io/synapsekit-docs/docs/roadmap)
|
|
52
|
+
|
|
53
|
+
### Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install synapsekit[openai] # or [anthropic], [ollama], [all]
|
|
57
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v5
|
|
15
|
+
- run: uv sync --group dev
|
|
16
|
+
- run: uv run ruff check src/ tests/
|
|
17
|
+
- run: uv run ruff format --check src/ tests/
|
|
18
|
+
|
|
19
|
+
typecheck:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: astral-sh/setup-uv@v5
|
|
24
|
+
- run: uv sync --group dev
|
|
25
|
+
- run: uv run mypy
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: astral-sh/setup-uv@v5
|
|
32
|
+
- run: uv sync --group dev
|
|
33
|
+
- run: uv run pytest tests/ -v
|
|
34
|
+
|
|
35
|
+
deptry:
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- uses: astral-sh/setup-uv@v5
|
|
40
|
+
- run: uv sync --group dev
|
|
41
|
+
- run: uv run deptry src/
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.so
|
|
5
|
+
.Python
|
|
6
|
+
build/
|
|
7
|
+
develop-eggs/
|
|
8
|
+
dist/
|
|
9
|
+
downloads/
|
|
10
|
+
eggs/
|
|
11
|
+
.eggs/
|
|
12
|
+
lib/
|
|
13
|
+
lib64/
|
|
14
|
+
parts/
|
|
15
|
+
sdist/
|
|
16
|
+
var/
|
|
17
|
+
wheels/
|
|
18
|
+
share/python-wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# Virtual environments
|
|
31
|
+
.env
|
|
32
|
+
.venv
|
|
33
|
+
env/
|
|
34
|
+
venv/
|
|
35
|
+
ENV/
|
|
36
|
+
env.bak/
|
|
37
|
+
venv.bak/
|
|
38
|
+
|
|
39
|
+
# Poetry
|
|
40
|
+
poetry.lock
|
|
41
|
+
|
|
42
|
+
# pytest
|
|
43
|
+
.pytest_cache/
|
|
44
|
+
.coverage
|
|
45
|
+
htmlcov/
|
|
46
|
+
|
|
47
|
+
# mypy
|
|
48
|
+
.mypy_cache/
|
|
49
|
+
.dmypy.json
|
|
50
|
+
dmypy.json
|
|
51
|
+
|
|
52
|
+
# IDE
|
|
53
|
+
.idea/
|
|
54
|
+
.vscode/
|
|
55
|
+
*.swp
|
|
56
|
+
*.swo
|
|
57
|
+
|
|
58
|
+
# OS
|
|
59
|
+
.DS_Store
|
|
60
|
+
Thumbs.db
|
|
61
|
+
|
|
62
|
+
# Claude
|
|
63
|
+
.claude/
|
|
64
|
+
CLAUDE.md
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
# Internal docs (not published)
|
|
68
|
+
docs/
|
|
69
|
+
|
|
70
|
+
# Saved vectorstores
|
|
71
|
+
*.npz
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: debug-statements
|
|
9
|
+
|
|
10
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
11
|
+
rev: v0.9.10
|
|
12
|
+
hooks:
|
|
13
|
+
- id: ruff
|
|
14
|
+
args: [--fix]
|
|
15
|
+
- id: ruff-format
|
|
16
|
+
|
|
17
|
+
- repo: https://github.com/fpgmaas/deptry
|
|
18
|
+
rev: 0.22.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: deptry
|
|
21
|
+
args: [src/]
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to SynapseKit are documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
SynapseKit uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.5.0] — 2026-03-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Text Splitters** — `BaseSplitter` ABC, `CharacterTextSplitter`, `RecursiveCharacterTextSplitter`, `TokenAwareSplitter`, `SemanticSplitter` (cosine similarity boundaries)
|
|
15
|
+
- **Function calling** — `call_with_tools()` added to `GeminiLLM` and `MistralLLM` (now 4 providers support native tool use)
|
|
16
|
+
- **LLM Caching** — `AsyncLRUCache` with SHA-256 cache keys, opt-in via `LLMConfig(cache=True)`
|
|
17
|
+
- **LLM Retries** — exponential backoff via `retry_async()`, skips auth errors, opt-in via `LLMConfig(max_retries=N)`
|
|
18
|
+
- **Graph Cycles** — `compile(allow_cycles=True)` skips static cycle detection for intentional loops
|
|
19
|
+
- **Configurable max_steps** — `compile(max_steps=N)` overrides the default `_MAX_STEPS=100` guard
|
|
20
|
+
- **Graph Checkpointing** — `BaseCheckpointer` ABC, `InMemoryCheckpointer`, `SQLiteCheckpointer`
|
|
21
|
+
- `CompiledGraph.resume(graph_id, checkpointer)` — re-execute from saved state
|
|
22
|
+
- Adjacency index optimization for `CompiledGraph._next_wave()`
|
|
23
|
+
- `RAGConfig.splitter` — plug any `BaseSplitter` into the RAG pipeline
|
|
24
|
+
- `TextSplitter` alias preserved for backward compatibility
|
|
25
|
+
- 65 new tests (332 total)
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `LLMConfig` gains `cache`, `cache_maxsize`, `max_retries`, `retry_delay` fields (all off by default)
|
|
30
|
+
- `pyproject.toml` description updated
|
|
31
|
+
- Version bumped to `0.5.0`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## [0.4.0] — 2026-03-11
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- **Graph Workflows** — `StateGraph` fluent builder with compile-time validation and DFS cycle detection
|
|
40
|
+
- **`CompiledGraph`** — wave-based async executor with `run()`, `stream()`, and `run_sync()`
|
|
41
|
+
- **`Node`**, **`Edge`**, **`ConditionalEdge`** — sync and async node functions, static and conditional routing
|
|
42
|
+
- **`agent_node()`**, **`rag_node()`** — wrap `AgentExecutor` or `RAGPipeline` as graph nodes
|
|
43
|
+
- **Parallel execution** — nodes in the same wave run concurrently via `asyncio.gather()`
|
|
44
|
+
- **Mermaid export** — `CompiledGraph.get_mermaid()` returns a flowchart string
|
|
45
|
+
- **`_MAX_STEPS = 100`** guard against infinite conditional loops
|
|
46
|
+
- **`GraphConfigError`**, **`GraphRuntimeError`** — distinct error types for build vs runtime failures
|
|
47
|
+
- 44 new tests (267 total)
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- **Build tooling** migrated from Poetry to [uv](https://github.com/astral-sh/uv)
|
|
52
|
+
- `pyproject.toml` updated to PEP 621 `[project]` format with hatchling build backend
|
|
53
|
+
- Version bumped to `0.4.0`
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## [0.3.0] — 2026-03-10
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- **`BaseTool` ABC** — `run()`, `schema()`, `anthropic_schema()`, `ToolResult`
|
|
62
|
+
- **`ToolRegistry`** — tool lookup by name, OpenAI and Anthropic schema generation
|
|
63
|
+
- **`AgentMemory`** — step scratchpad with `format_scratchpad()` and `max_steps` limit
|
|
64
|
+
- **`ReActAgent`** — Thought → Action → Observation loop, works with any `BaseLLM`
|
|
65
|
+
- **`FunctionCallingAgent`** — native OpenAI `tool_calls` and Anthropic `tool_use`, multi-tool per step
|
|
66
|
+
- **`AgentExecutor`** — unified runner with `run()`, `stream()`, `run_sync()`, auto-selects agent type
|
|
67
|
+
- **`call_with_tools()`** — added to `OpenAILLM` and `AnthropicLLM`
|
|
68
|
+
- **Built-in tools**: `CalculatorTool`, `PythonREPLTool`, `FileReadTool`, `WebSearchTool`, `SQLQueryTool`
|
|
69
|
+
- 82 new tests (223 total)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## [0.2.0] — 2026-03-08
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- **Loaders**: `PDFLoader`, `HTMLLoader`, `CSVLoader`, `JSONLoader`, `DirectoryLoader`, `WebLoader`
|
|
78
|
+
- **Output parsers**: `JSONParser`, `PydanticParser`, `ListParser`
|
|
79
|
+
- **Vector store backends**: `ChromaVectorStore`, `FAISSVectorStore`, `QdrantVectorStore`, `PineconeVectorStore`
|
|
80
|
+
- **LLM providers**: `OllamaLLM`, `CohereLLM`, `MistralLLM`, `GeminiLLM`, `BedrockLLM`
|
|
81
|
+
- **Prompt templates**: `PromptTemplate`, `ChatPromptTemplate`, `FewShotPromptTemplate`
|
|
82
|
+
- **`VectorStore` ABC** — unified interface for all backends
|
|
83
|
+
- `Retriever.add()` — cleaner public API
|
|
84
|
+
- `RAGPipeline.add_documents(docs)` — ingest `List[Document]` directly
|
|
85
|
+
- `RAG.add_documents()` and `RAG.add_documents_async()`
|
|
86
|
+
- 89 new tests (141 total)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## [0.1.0] — 2026-03-05
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
|
|
94
|
+
- **`BaseLLM` ABC** and `LLMConfig`
|
|
95
|
+
- **`OpenAILLM`** — async streaming
|
|
96
|
+
- **`AnthropicLLM`** — async streaming
|
|
97
|
+
- **`SynapsekitEmbeddings`** — sentence-transformers backend
|
|
98
|
+
- **`InMemoryVectorStore`** — numpy cosine similarity with `.npz` persistence
|
|
99
|
+
- **`Retriever`** — vector search with optional BM25 reranking
|
|
100
|
+
- **`TextSplitter`** — pure Python, zero dependencies
|
|
101
|
+
- **`ConversationMemory`** — sliding window
|
|
102
|
+
- **`TokenTracer`** — tokens, latency, and cost per call
|
|
103
|
+
- **`TextLoader`**, **`StringLoader`**
|
|
104
|
+
- **`RAGPipeline`** — full retrieval-augmented generation orchestrator
|
|
105
|
+
- **`RAG`** facade — 3-line happy path
|
|
106
|
+
- **`run_sync()`** — works inside and outside running event loops
|
|
107
|
+
- 52 tests
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as contributors and maintainers pledge to make participation in SynapseKit a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
**Examples of behaviour that contributes to a positive environment:**
|
|
10
|
+
|
|
11
|
+
- Being respectful and constructive in discussions
|
|
12
|
+
- Welcoming newcomers and helping them get started
|
|
13
|
+
- Accepting feedback gracefully and giving it thoughtfully
|
|
14
|
+
- Focusing on what is best for the community and the project
|
|
15
|
+
|
|
16
|
+
**Examples of unacceptable behaviour:**
|
|
17
|
+
|
|
18
|
+
- Harassment, insults, or derogatory comments in any form
|
|
19
|
+
- Personal or political attacks
|
|
20
|
+
- Publishing others' private information without explicit permission
|
|
21
|
+
- Dismissing or belittling contributions, questions, or ideas
|
|
22
|
+
|
|
23
|
+
## Scope
|
|
24
|
+
|
|
25
|
+
This Code of Conduct applies in all project spaces — GitHub issues, pull requests, discussions, and any other community forum associated with SynapseKit.
|
|
26
|
+
|
|
27
|
+
## Enforcement
|
|
28
|
+
|
|
29
|
+
Instances of unacceptable behaviour may be reported by opening a [private security advisory](https://github.com/SynapseKit/SynapseKit/security/advisories/new) or contacting the maintainer directly. All reports will be reviewed and investigated promptly and fairly.
|
|
30
|
+
|
|
31
|
+
Maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that do not align with this Code of Conduct, and to ban contributors for behaviours they deem inappropriate.
|
|
32
|
+
|
|
33
|
+
## Attribution
|
|
34
|
+
|
|
35
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
|