bfa-irc-a-sdk 0.3.0.dev14__tar.gz → 0.3.0.dev28__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.
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_irc_a_sdk.egg-info → bfa_irc_a_sdk-0.3.0.dev28}/PKG-INFO +3 -3
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/README.md +1 -1
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28/bfa_irc_a_sdk.egg-info}/PKG-INFO +3 -3
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/bfa_irc_a_sdk.egg-info/SOURCES.txt +11 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_irc_a_sdk.egg-info/entry_points.txt +2 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_irc_a_sdk.egg-info/top_level.txt +2 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/__init__.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/config.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/core/agent.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/core/gateway.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/core/interactive_agent.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/core/mcp.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/core/paseto.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/router/embedder.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/bfa_sdk/router/search.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/irca_sdk/__init__.py +79 -0
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/config.py +4 -0
- bfa_irc_a_sdk-0.3.0.dev28/irca_sdk/core/__init__.py +3 -0
- bfa_irc_a_sdk-0.3.0.dev28/irca_sdk/core/agent.py +1090 -0
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/core/gateway.py +992 -235
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/core/interactive_agent.py +33 -9
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/core/mcp.py +49 -14
- bfa_irc_a_sdk-0.3.0.dev28/irca_sdk/core/task_queue.py +389 -0
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/router/search.py +68 -12
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/pyproject.toml +8 -4
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_core_wrappers.py +56 -5
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_interactive_agent.py +31 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_irca_security.py +478 -0
- bfa_irc_a_sdk-0.3.0.dev28/tests/test_router.py +193 -0
- bfa_irc_a_sdk-0.3.0.dev14/bfa_irc_a_sdk.egg-info/entry_points.txt +0 -2
- bfa_irc_a_sdk-0.3.0.dev14/bfa_irc_a_sdk.egg-info/top_level.txt +0 -1
- bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk/__init__.py +0 -16
- bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk/core/agent.py +0 -532
- bfa_irc_a_sdk-0.3.0.dev14/tests/test_router.py +0 -109
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/LICENSE +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/LICENSE_MATRIX.md +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/bfa_irc_a_sdk.egg-info/dependency_links.txt +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/bfa_irc_a_sdk.egg-info/requires.txt +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/bfa_sdk/core/__init__.py +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/core/paseto.py +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14/bfa_sdk → bfa_irc_a_sdk-0.3.0.dev28/irca_sdk}/router/embedder.py +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/setup.cfg +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_config.py +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_embedder.py +0 -0
- {bfa_irc_a_sdk-0.3.0.dev14 → bfa_irc_a_sdk-0.3.0.dev28}/tests/test_gateway.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bfa-irc-a-sdk
|
|
3
|
-
Version: 0.3.0.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 0.3.0.dev28
|
|
4
|
+
Summary: Official Python SDK for the IRC-A (Internet Relay Chat for Agents) protocol with FAISS semantic routing.
|
|
5
5
|
Author: Sandro Garcia
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
|
33
33
|
A generic and opinionated framework and SDK to implement the **BFA (Backend for Agents)** pattern and the **IRC-A (Internet Relay Chat for Agents)** protocol, featuring native support for **FAISS-based Semantic Routing (vector search)**, asymmetric zero-trust security boundaries, and standard abstractions for A2A Agents and MCP Servers.
|
|
34
34
|
|
|
35
35
|
Read the official protocol specification:
|
|
36
|
-
👉 **[IRC-A Protocol Whitepaper
|
|
36
|
+
👉 **[IRC-A Protocol Whitepaper](https://github.com/IRC-A/whitepaper)** - *Decentralized Agent Networks, Semantic Capability Routing, and Secure-by-Design Software Architecture.*
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A generic and opinionated framework and SDK to implement the **BFA (Backend for Agents)** pattern and the **IRC-A (Internet Relay Chat for Agents)** protocol, featuring native support for **FAISS-based Semantic Routing (vector search)**, asymmetric zero-trust security boundaries, and standard abstractions for A2A Agents and MCP Servers.
|
|
4
4
|
|
|
5
5
|
Read the official protocol specification:
|
|
6
|
-
👉 **[IRC-A Protocol Whitepaper
|
|
6
|
+
👉 **[IRC-A Protocol Whitepaper](https://github.com/IRC-A/whitepaper)** - *Decentralized Agent Networks, Semantic Capability Routing, and Secure-by-Design Software Architecture.*
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bfa-irc-a-sdk
|
|
3
|
-
Version: 0.3.0.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 0.3.0.dev28
|
|
4
|
+
Summary: Official Python SDK for the IRC-A (Internet Relay Chat for Agents) protocol with FAISS semantic routing.
|
|
5
5
|
Author: Sandro Garcia
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
7
7
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -33,7 +33,7 @@ Dynamic: license-file
|
|
|
33
33
|
A generic and opinionated framework and SDK to implement the **BFA (Backend for Agents)** pattern and the **IRC-A (Internet Relay Chat for Agents)** protocol, featuring native support for **FAISS-based Semantic Routing (vector search)**, asymmetric zero-trust security boundaries, and standard abstractions for A2A Agents and MCP Servers.
|
|
34
34
|
|
|
35
35
|
Read the official protocol specification:
|
|
36
|
-
👉 **[IRC-A Protocol Whitepaper
|
|
36
|
+
👉 **[IRC-A Protocol Whitepaper](https://github.com/IRC-A/whitepaper)** - *Decentralized Agent Networks, Semantic Capability Routing, and Secure-by-Design Software Architecture.*
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
@@ -18,6 +18,17 @@ bfa_sdk/core/mcp.py
|
|
|
18
18
|
bfa_sdk/core/paseto.py
|
|
19
19
|
bfa_sdk/router/embedder.py
|
|
20
20
|
bfa_sdk/router/search.py
|
|
21
|
+
irca_sdk/__init__.py
|
|
22
|
+
irca_sdk/config.py
|
|
23
|
+
irca_sdk/core/__init__.py
|
|
24
|
+
irca_sdk/core/agent.py
|
|
25
|
+
irca_sdk/core/gateway.py
|
|
26
|
+
irca_sdk/core/interactive_agent.py
|
|
27
|
+
irca_sdk/core/mcp.py
|
|
28
|
+
irca_sdk/core/paseto.py
|
|
29
|
+
irca_sdk/core/task_queue.py
|
|
30
|
+
irca_sdk/router/embedder.py
|
|
31
|
+
irca_sdk/router/search.py
|
|
21
32
|
tests/test_config.py
|
|
22
33
|
tests/test_core_wrappers.py
|
|
23
34
|
tests/test_embedder.py
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copyright (c) 2026 Sandro G. All rights reserved.
|
|
2
|
+
# Licensed under AGPLv3 / Commercial Dual License.
|
|
3
|
+
# Backend for Agents SDK (BFA)
|
|
4
|
+
# Version 0.3.0
|
|
5
|
+
"""
|
|
6
|
+
BFA SDK: A lightweight framework for Backend for Agents (BFA) architecture with FAISS semantic routing.
|
|
7
|
+
"""
|
|
8
|
+
import os
|
|
9
|
+
import logging
|
|
10
|
+
|
|
11
|
+
enable_access_log = os.getenv("BFA_ACCESS_LOG", "false").lower() in ("true", "1", "yes")
|
|
12
|
+
|
|
13
|
+
if not enable_access_log:
|
|
14
|
+
logging.getLogger("uvicorn.access").disabled = True
|
|
15
|
+
try:
|
|
16
|
+
import uvicorn.config
|
|
17
|
+
if "loggers" in uvicorn.config.LOGGING_CONFIG and "uvicorn.access" in uvicorn.config.LOGGING_CONFIG["loggers"]:
|
|
18
|
+
uvicorn.config.LOGGING_CONFIG["loggers"]["uvicorn.access"]["handlers"] = []
|
|
19
|
+
except Exception:
|
|
20
|
+
pass
|
|
21
|
+
else:
|
|
22
|
+
class _SilentProbeFilter(logging.Filter):
|
|
23
|
+
SILENT_PATHS = {"/tools", "/ping", "/health", "/.well-known/agent-card.json"}
|
|
24
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
25
|
+
args = getattr(record, "args", None)
|
|
26
|
+
if isinstance(args, tuple) and len(args) >= 3:
|
|
27
|
+
_, method, full_path, *_ = args
|
|
28
|
+
path = str(full_path).split("?", 1)[0]
|
|
29
|
+
if path in self.SILENT_PATHS and method == "GET":
|
|
30
|
+
return False
|
|
31
|
+
msg = record.getMessage()
|
|
32
|
+
if any(f" {p} " in msg or f'"{p}' in msg or f"'{p}'" in msg for p in self.SILENT_PATHS) and "POST" not in msg:
|
|
33
|
+
return False
|
|
34
|
+
return True
|
|
35
|
+
|
|
36
|
+
logging.getLogger("uvicorn.access").addFilter(_SilentProbeFilter())
|
|
37
|
+
|
|
38
|
+
logging.getLogger("httpx").setLevel(logging.WARNING)
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
from irca_sdk.core.agent import IRCAAgent, BFAAgent
|
|
42
|
+
from irca_sdk.core.interactive_agent import IRCAInteractiveAgent, BFAInteractiveAgent
|
|
43
|
+
except ImportError:
|
|
44
|
+
IRCAAgent = None # type: ignore
|
|
45
|
+
BFAAgent = None # type: ignore
|
|
46
|
+
IRCAInteractiveAgent = None # type: ignore
|
|
47
|
+
BFAInteractiveAgent = None # type: ignore
|
|
48
|
+
|
|
49
|
+
try:
|
|
50
|
+
from irca_sdk.core.mcp import IRCAMCP, BFAMCP
|
|
51
|
+
except ImportError:
|
|
52
|
+
IRCAMCP = None # type: ignore
|
|
53
|
+
BFAMCP = None # type: ignore
|
|
54
|
+
|
|
55
|
+
from irca_sdk.core.gateway import create_gateway_app
|
|
56
|
+
from irca_sdk.router.search import BFASemanticRouter
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
from irca_sdk.core.task_queue import TaskQueue, SubTask, decompose_prompt_to_tasks, extract_parameters_from_text
|
|
60
|
+
except ImportError:
|
|
61
|
+
TaskQueue = None # type: ignore
|
|
62
|
+
SubTask = None # type: ignore
|
|
63
|
+
decompose_prompt_to_tasks = None # type: ignore
|
|
64
|
+
extract_parameters_from_text = None # type: ignore
|
|
65
|
+
|
|
66
|
+
__all__ = [
|
|
67
|
+
"IRCAAgent",
|
|
68
|
+
"IRCAMCP",
|
|
69
|
+
"IRCAInteractiveAgent",
|
|
70
|
+
"BFAAgent",
|
|
71
|
+
"BFAMCP",
|
|
72
|
+
"BFAInteractiveAgent",
|
|
73
|
+
"create_gateway_app",
|
|
74
|
+
"BFASemanticRouter",
|
|
75
|
+
"TaskQueue",
|
|
76
|
+
"SubTask",
|
|
77
|
+
"decompose_prompt_to_tasks",
|
|
78
|
+
"extract_parameters_from_text"
|
|
79
|
+
]
|
|
@@ -17,6 +17,7 @@ class BFAConfig:
|
|
|
17
17
|
self.use_openai_embeddings: bool = False
|
|
18
18
|
self.openai_api_key: str = ""
|
|
19
19
|
self.semantic_threshold: float = 0.5
|
|
20
|
+
self.enable_active_pruning: bool = True
|
|
20
21
|
|
|
21
22
|
# Load from config file if provided
|
|
22
23
|
if config_path and os.path.exists(config_path):
|
|
@@ -34,6 +35,7 @@ class BFAConfig:
|
|
|
34
35
|
self.use_openai_embeddings = data.get("use_openai_embeddings", False)
|
|
35
36
|
self.openai_api_key = data.get("openai_api_key", "")
|
|
36
37
|
self.semantic_threshold = float(data.get("semantic_threshold", self.semantic_threshold))
|
|
38
|
+
self.enable_active_pruning = bool(data.get("enable_active_pruning", True))
|
|
37
39
|
|
|
38
40
|
def load_from_env(self):
|
|
39
41
|
# Parse comma-separated strings
|
|
@@ -48,3 +50,5 @@ class BFAConfig:
|
|
|
48
50
|
self.use_openai_embeddings = os.getenv("BFA_USE_OPENAI_EMBEDDINGS", "false").lower() in ("true", "1")
|
|
49
51
|
self.openai_api_key = os.getenv("OPENAI_API_KEY", "")
|
|
50
52
|
self.semantic_threshold = float(os.getenv("BFA_SEMANTIC_THRESHOLD", "0.5"))
|
|
53
|
+
is_pytest = bool(os.getenv("PYTEST_CURRENT_TEST"))
|
|
54
|
+
self.enable_active_pruning = os.getenv("BFA_ENABLE_ACTIVE_PRUNING", "false" if is_pytest else "true").lower() in ("true", "1")
|