bilinc 1.0.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.
- bilinc-1.0.0/LICENSE +21 -0
- bilinc-1.0.0/PKG-INFO +499 -0
- bilinc-1.0.0/README.md +463 -0
- bilinc-1.0.0/pyproject.toml +77 -0
- bilinc-1.0.0/setup.cfg +4 -0
- bilinc-1.0.0/src/bilinc/__init__.py +41 -0
- bilinc-1.0.0/src/bilinc/adaptive/__init__.py +5 -0
- bilinc-1.0.0/src/bilinc/adaptive/agm_engine.py +719 -0
- bilinc-1.0.0/src/bilinc/adaptive/budget.py +186 -0
- bilinc-1.0.0/src/bilinc/adaptive/consolidation.py +201 -0
- bilinc-1.0.0/src/bilinc/adaptive/forgetting.py +225 -0
- bilinc-1.0.0/src/bilinc/adaptive/forgetting_engine.py +218 -0
- bilinc-1.0.0/src/bilinc/adaptive/policy.py +437 -0
- bilinc-1.0.0/src/bilinc/cli/__init__.py +1 -0
- bilinc-1.0.0/src/bilinc/cli/__main__.py +5 -0
- bilinc-1.0.0/src/bilinc/cli/main.py +316 -0
- bilinc-1.0.0/src/bilinc/core/__init__.py +36 -0
- bilinc-1.0.0/src/bilinc/core/agm.py +393 -0
- bilinc-1.0.0/src/bilinc/core/audit.py +237 -0
- bilinc-1.0.0/src/bilinc/core/belief_sync.py +428 -0
- bilinc-1.0.0/src/bilinc/core/confidence.py +170 -0
- bilinc-1.0.0/src/bilinc/core/dual_process.py +325 -0
- bilinc-1.0.0/src/bilinc/core/knowledge_graph.py +409 -0
- bilinc-1.0.0/src/bilinc/core/models.py +130 -0
- bilinc-1.0.0/src/bilinc/core/stateplane.py +621 -0
- bilinc-1.0.0/src/bilinc/core/verification.py +292 -0
- bilinc-1.0.0/src/bilinc/core/verifier.py +303 -0
- bilinc-1.0.0/src/bilinc/core/working_memory.py +124 -0
- bilinc-1.0.0/src/bilinc/integrations/__init__.py +4 -0
- bilinc-1.0.0/src/bilinc/integrations/cross_tool.py +448 -0
- bilinc-1.0.0/src/bilinc/integrations/langgraph.py +235 -0
- bilinc-1.0.0/src/bilinc/mcp_server/__init__.py +1 -0
- bilinc-1.0.0/src/bilinc/mcp_server/_deprecated_server.py +15 -0
- bilinc-1.0.0/src/bilinc/mcp_server/rate_limiter.py +100 -0
- bilinc-1.0.0/src/bilinc/mcp_server/server.py +14 -0
- bilinc-1.0.0/src/bilinc/mcp_server/server_v2.py +1032 -0
- bilinc-1.0.0/src/bilinc/observability/__init__.py +6 -0
- bilinc-1.0.0/src/bilinc/observability/health.py +190 -0
- bilinc-1.0.0/src/bilinc/observability/logging.py +14 -0
- bilinc-1.0.0/src/bilinc/observability/metrics.py +114 -0
- bilinc-1.0.0/src/bilinc/retrieval/__init__.py +3 -0
- bilinc-1.0.0/src/bilinc/retrieval/hybrid.py +233 -0
- bilinc-1.0.0/src/bilinc/security/__init__.py +5 -0
- bilinc-1.0.0/src/bilinc/security/input_validator.py +82 -0
- bilinc-1.0.0/src/bilinc/security/resource_limits.py +48 -0
- bilinc-1.0.0/src/bilinc/security/validator.py +43 -0
- bilinc-1.0.0/src/bilinc/storage/__init__.py +6 -0
- bilinc-1.0.0/src/bilinc/storage/backend.py +21 -0
- bilinc-1.0.0/src/bilinc/storage/memory.py +20 -0
- bilinc-1.0.0/src/bilinc/storage/postgres.py +274 -0
- bilinc-1.0.0/src/bilinc/storage/sqlite.py +231 -0
- bilinc-1.0.0/src/bilinc.egg-info/PKG-INFO +499 -0
- bilinc-1.0.0/src/bilinc.egg-info/SOURCES.txt +67 -0
- bilinc-1.0.0/src/bilinc.egg-info/dependency_links.txt +1 -0
- bilinc-1.0.0/src/bilinc.egg-info/entry_points.txt +2 -0
- bilinc-1.0.0/src/bilinc.egg-info/requires.txt +20 -0
- bilinc-1.0.0/src/bilinc.egg-info/top_level.txt +1 -0
- bilinc-1.0.0/tests/test_agm_engine.py +276 -0
- bilinc-1.0.0/tests/test_belief_sync.py +237 -0
- bilinc-1.0.0/tests/test_core.py +148 -0
- bilinc-1.0.0/tests/test_integration.py +101 -0
- bilinc-1.0.0/tests/test_knowledge_graph.py +275 -0
- bilinc-1.0.0/tests/test_mcp_http.py +158 -0
- bilinc-1.0.0/tests/test_mcp_server_v2.py +267 -0
- bilinc-1.0.0/tests/test_observability.py +146 -0
- bilinc-1.0.0/tests/test_phase3_integration.py +197 -0
- bilinc-1.0.0/tests/test_postgres_integration.py +102 -0
- bilinc-1.0.0/tests/test_security.py +65 -0
- bilinc-1.0.0/tests/test_sqlite_integration.py +274 -0
bilinc-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atakan Elik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
bilinc-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bilinc
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Verifiable State Plane for Autonomous Agents
|
|
5
|
+
Author: Bilinc Team
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: ai-agent-memory,context-management,belief-revision,state-plane,agm,mcp-server,verification,context-budget,neuro-symbolic
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: mcp>=1.0.0
|
|
19
|
+
Requires-Dist: pydantic>=2.0
|
|
20
|
+
Requires-Dist: z3-solver>=4.12.0
|
|
21
|
+
Requires-Dist: networkx>=3.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
27
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.1; extra == "dev"
|
|
29
|
+
Provides-Extra: postgres
|
|
30
|
+
Requires-Dist: asyncpg>=0.29; extra == "postgres"
|
|
31
|
+
Requires-Dist: pgvector>=0.2; extra == "postgres"
|
|
32
|
+
Provides-Extra: server
|
|
33
|
+
Requires-Dist: fastapi>=0.110; extra == "server"
|
|
34
|
+
Requires-Dist: uvicorn>=0.27; extra == "server"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# Bilinc
|
|
38
|
+
|
|
39
|
+
**Verifiable state plane for autonomous agents**
|
|
40
|
+
|
|
41
|
+
[](https://pypi.org/project/bilinc/)
|
|
42
|
+
[](https://github.com/atakanelik34/Bilinc/actions/workflows/ci.yml)
|
|
43
|
+
[](LICENSE)
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
*A trustworthy state layer for long-running AI agents.*
|
|
47
|
+
|
|
48
|
+
Bilinc helps agents keep state that is durable, reviewable, and safer to evolve over time. It combines persistence, verification, belief revision, rollback tooling, MCP access, and operator-facing health and metrics in a single Python package.
|
|
49
|
+
|
|
50
|
+
## What Bilinc Is
|
|
51
|
+
|
|
52
|
+
Bilinc is a **context control plane** for autonomous agents.
|
|
53
|
+
|
|
54
|
+
Most memory tools focus on storing and retrieving context. Bilinc is built for the harder problem: keeping agent state usable over time when beliefs change, contradictions appear, multiple tools touch the same memory, and operators need to understand what changed and why.
|
|
55
|
+
|
|
56
|
+
In practice, that means Bilinc provides:
|
|
57
|
+
|
|
58
|
+
- a `StatePlane` API for memory and state operations
|
|
59
|
+
- durable storage backends
|
|
60
|
+
- verification and audit-aware state handling
|
|
61
|
+
- snapshot, diff, and rollback workflows
|
|
62
|
+
- MCP access over stdio and authenticated HTTP
|
|
63
|
+
- health and Prometheus-style metrics
|
|
64
|
+
|
|
65
|
+
## The Problem Bilinc Solves
|
|
66
|
+
|
|
67
|
+
Long-running agents usually break down in familiar ways:
|
|
68
|
+
|
|
69
|
+
- they keep stale information too long
|
|
70
|
+
- they overwrite useful context without discipline
|
|
71
|
+
- they accumulate contradictions
|
|
72
|
+
- they expose “memory” without persistence, rollback, auth, or observability
|
|
73
|
+
|
|
74
|
+
That gap matters. A memory layer that works in a demo but cannot be trusted in a real system quickly becomes operational debt.
|
|
75
|
+
|
|
76
|
+
Bilinc exists to close that gap.
|
|
77
|
+
|
|
78
|
+
## Why Bilinc Is Different
|
|
79
|
+
|
|
80
|
+
Bilinc is not positioned as just another memory library.
|
|
81
|
+
|
|
82
|
+
It is designed as a **trustworthy state layer** for agents:
|
|
83
|
+
|
|
84
|
+
- **Verify before commit**
|
|
85
|
+
State can pass through validation and verification logic instead of being blindly stored.
|
|
86
|
+
- **Belief revision, not only retrieval**
|
|
87
|
+
Bilinc includes AGM-style belief revision machinery for changing or conflicting state.
|
|
88
|
+
- **Durable persistence**
|
|
89
|
+
SQLite persistence is part of the normal workflow, not a side feature.
|
|
90
|
+
- **Recovery primitives**
|
|
91
|
+
Snapshot, diff, and rollback exist for persistent state.
|
|
92
|
+
- **Operational MCP surface**
|
|
93
|
+
HTTP MCP includes bearer auth, rate limiting, health, and metrics.
|
|
94
|
+
- **Operator visibility**
|
|
95
|
+
Bilinc exposes deployment signals through `/health` and `/metrics`.
|
|
96
|
+
|
|
97
|
+
## Core Capabilities
|
|
98
|
+
|
|
99
|
+
- **StatePlane core**
|
|
100
|
+
Unified API for commit, recall, forget, snapshot, diff, rollback, and component initialization.
|
|
101
|
+
- **Persistent storage**
|
|
102
|
+
SQLite support today, PostgreSQL backend included and CI-validated.
|
|
103
|
+
- **Verification and audit**
|
|
104
|
+
Z3-backed verification and audit-aware state reconstruction.
|
|
105
|
+
- **Belief revision**
|
|
106
|
+
AGM-style revision workflows for conflicting or changing beliefs.
|
|
107
|
+
- **Knowledge graph**
|
|
108
|
+
Semantic memory can be projected into a graph for traversal and contradiction analysis.
|
|
109
|
+
- **MCP server**
|
|
110
|
+
12 MCP tools for memory and state operations.
|
|
111
|
+
- **HTTP deployment surface**
|
|
112
|
+
Authenticated transport with rate limiting, health, and metrics.
|
|
113
|
+
- **Observability**
|
|
114
|
+
In-process metrics plus Prometheus-compatible export.
|
|
115
|
+
|
|
116
|
+
## Support and Maturity Matrix
|
|
117
|
+
|
|
118
|
+
| Surface | Status | Notes |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| Core `StatePlane` API | Production-capable | Main package surface, covered by tests |
|
|
121
|
+
| SQLite persistence | Production-capable | Persistent CLI and backend support |
|
|
122
|
+
| MCP stdio transport | Supported | Trusted local process boundary, no request-level auth |
|
|
123
|
+
| MCP HTTP transport | Production-capable | Bearer auth, rate limiting, health, metrics |
|
|
124
|
+
| Snapshot / diff / rollback | Supported on persistent backends | Intended for durable state workflows |
|
|
125
|
+
| `/health` and `/metrics` | Production-capable | Operator-facing HTTP endpoints |
|
|
126
|
+
| Knowledge graph | Supported | Included in package and docs |
|
|
127
|
+
| AGM belief revision | Supported | Included in package and docs |
|
|
128
|
+
| PostgreSQL backend | CI-validated support | Backend integration job exists in CI |
|
|
129
|
+
| LangGraph adapter | Not currently a supported public surface | Do not treat as maintained product surface |
|
|
130
|
+
| Hosted service / multi-tenant platform | Planned | Not part of this repository today |
|
|
131
|
+
|
|
132
|
+
## Architecture Overview
|
|
133
|
+
|
|
134
|
+
Bilinc is organized as a layered agent-state system:
|
|
135
|
+
|
|
136
|
+
1. **Core state layer**
|
|
137
|
+
`StatePlane` coordinates commits, recall, forgetting, rollback, and component initialization.
|
|
138
|
+
2. **Persistence layer**
|
|
139
|
+
SQLite and PostgreSQL backends provide durable storage.
|
|
140
|
+
3. **Verification and audit**
|
|
141
|
+
Verification and audit trail logic support correctness and replayable state history.
|
|
142
|
+
4. **Belief management**
|
|
143
|
+
AGM-style revision supports controlled state updates under conflict.
|
|
144
|
+
5. **Knowledge graph**
|
|
145
|
+
Semantic memory can be represented structurally and queried.
|
|
146
|
+
6. **Transport layer**
|
|
147
|
+
MCP is exposed through stdio and HTTP.
|
|
148
|
+
7. **Operations layer**
|
|
149
|
+
Health and metrics support deployment and monitoring.
|
|
150
|
+
|
|
151
|
+
## Install
|
|
152
|
+
|
|
153
|
+
Basic install:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
pip install bilinc
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Development install:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pip install -e '.[dev]'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
PostgreSQL extras:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
pip install -e '.[dev,postgres]'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Server-oriented extras:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
pip install -e '.[server]'
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Bilinc supports **Python 3.10+**.
|
|
178
|
+
|
|
179
|
+
## Quick Start
|
|
180
|
+
|
|
181
|
+
### Python API
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
from bilinc import StatePlane
|
|
185
|
+
|
|
186
|
+
plane = StatePlane()
|
|
187
|
+
plane.init()
|
|
188
|
+
|
|
189
|
+
result = plane.commit_sync(
|
|
190
|
+
key="user.pref.editor",
|
|
191
|
+
value={"name": "cursor", "theme": "dark"},
|
|
192
|
+
memory_type="semantic",
|
|
193
|
+
importance=0.8,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
print(result.success)
|
|
197
|
+
print(len(plane.recall_all_sync()))
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### With Durable Storage
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
from bilinc import StatePlane
|
|
204
|
+
from bilinc.storage.sqlite import SQLiteBackend
|
|
205
|
+
|
|
206
|
+
backend = SQLiteBackend("./bilinc.db")
|
|
207
|
+
plane = StatePlane(backend=backend)
|
|
208
|
+
plane.init()
|
|
209
|
+
|
|
210
|
+
plane.commit_sync(
|
|
211
|
+
key="team.policy",
|
|
212
|
+
value={"deploy_window": "weekday"},
|
|
213
|
+
memory_type="semantic",
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
entry = plane.working_memory.get("team.policy")
|
|
217
|
+
print(entry.value)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Persistent CLI Usage
|
|
221
|
+
|
|
222
|
+
Bilinc ships with a CLI.
|
|
223
|
+
|
|
224
|
+
### Ephemeral mode
|
|
225
|
+
|
|
226
|
+
Without `--db`, the CLI runs in in-memory mode:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
bilinc status
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
This mode is useful for quick inspection and local testing, but it is **not persistent across separate CLI invocations**.
|
|
233
|
+
|
|
234
|
+
### SQLite-backed persistent mode
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
bilinc --db ./bilinc.db commit --key team.owner --value alice
|
|
238
|
+
bilinc --db ./bilinc.db recall --key team.owner
|
|
239
|
+
bilinc --db ./bilinc.db forget --key team.owner
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
You can also provide the backend through an environment variable:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
export BILINC_DB_URL=./bilinc.db
|
|
246
|
+
bilinc commit --key app.mode --value production
|
|
247
|
+
bilinc recall --key app.mode
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## MCP Usage
|
|
251
|
+
|
|
252
|
+
Bilinc exposes an MCP surface for agent runtimes and tool ecosystems.
|
|
253
|
+
|
|
254
|
+
### Stdio transport
|
|
255
|
+
|
|
256
|
+
Use stdio when Bilinc runs as a trusted local process behind an MCP client.
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
import asyncio
|
|
260
|
+
from bilinc import StatePlane
|
|
261
|
+
from bilinc.mcp_server.server_v2 import create_mcp_server_v2
|
|
262
|
+
from mcp.server.stdio import stdio_server
|
|
263
|
+
|
|
264
|
+
plane = StatePlane()
|
|
265
|
+
plane.init_agm()
|
|
266
|
+
plane.init_knowledge_graph()
|
|
267
|
+
|
|
268
|
+
server = create_mcp_server_v2(plane)
|
|
269
|
+
|
|
270
|
+
async def main():
|
|
271
|
+
async with stdio_server() as (read_stream, write_stream):
|
|
272
|
+
await server.run(read_stream, write_stream, server.create_initialization_options())
|
|
273
|
+
|
|
274
|
+
asyncio.run(main())
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Security note:** stdio is a **trusted local process boundary**. It is intentionally **unauthenticated at the request level**.
|
|
278
|
+
|
|
279
|
+
### HTTP transport
|
|
280
|
+
|
|
281
|
+
Use HTTP for production-facing deployments.
|
|
282
|
+
|
|
283
|
+
```python
|
|
284
|
+
from bilinc import StatePlane
|
|
285
|
+
from bilinc.mcp_server.server_v2 import create_mcp_http_app
|
|
286
|
+
|
|
287
|
+
plane = StatePlane()
|
|
288
|
+
plane.init_agm()
|
|
289
|
+
plane.init_knowledge_graph()
|
|
290
|
+
|
|
291
|
+
app = create_mcp_http_app(
|
|
292
|
+
plane=plane,
|
|
293
|
+
auth_token="replace-me",
|
|
294
|
+
route_prefix="/mcp",
|
|
295
|
+
)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Run it with your ASGI server:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
uvicorn yourmodule:app --host 0.0.0.0 --port 8000
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
HTTP behavior:
|
|
305
|
+
|
|
306
|
+
- `Authorization: Bearer <token>` is required by default
|
|
307
|
+
- missing token: `401`
|
|
308
|
+
- invalid token: `401`
|
|
309
|
+
- rate-limited client: `429`
|
|
310
|
+
|
|
311
|
+
Available MCP tools:
|
|
312
|
+
|
|
313
|
+
- `commit_mem`
|
|
314
|
+
- `recall`
|
|
315
|
+
- `forget`
|
|
316
|
+
- `revise`
|
|
317
|
+
- `status`
|
|
318
|
+
- `verify`
|
|
319
|
+
- `consolidate`
|
|
320
|
+
- `snapshot`
|
|
321
|
+
- `diff`
|
|
322
|
+
- `rollback`
|
|
323
|
+
- `query_graph`
|
|
324
|
+
- `contradictions`
|
|
325
|
+
|
|
326
|
+
## Security Model
|
|
327
|
+
|
|
328
|
+
Bilinc has two deliberate trust boundaries.
|
|
329
|
+
|
|
330
|
+
### Stdio
|
|
331
|
+
|
|
332
|
+
- intended for trusted local process use
|
|
333
|
+
- no request-level auth
|
|
334
|
+
- appropriate when the MCP client and Bilinc run in the same trust domain
|
|
335
|
+
|
|
336
|
+
### HTTP
|
|
337
|
+
|
|
338
|
+
- intended as the production-facing transport
|
|
339
|
+
- bearer token auth enforced by default
|
|
340
|
+
- rate limiting enforced
|
|
341
|
+
- health and metrics available through the same deployment surface
|
|
342
|
+
|
|
343
|
+
Other security-relevant behavior:
|
|
344
|
+
|
|
345
|
+
- input validation for keys and values
|
|
346
|
+
- resource limits for memory and graph growth
|
|
347
|
+
- audit support when enabled
|
|
348
|
+
- constant-time token comparison for HTTP auth
|
|
349
|
+
|
|
350
|
+
## Observability, Health, and Metrics
|
|
351
|
+
|
|
352
|
+
Bilinc includes a real operator surface.
|
|
353
|
+
|
|
354
|
+
### Health
|
|
355
|
+
|
|
356
|
+
- `GET /health`
|
|
357
|
+
- reports both `liveness` and `readiness`
|
|
358
|
+
- uses explicit states:
|
|
359
|
+
- `healthy`
|
|
360
|
+
- `degraded`
|
|
361
|
+
- `failed`
|
|
362
|
+
|
|
363
|
+
### Metrics
|
|
364
|
+
|
|
365
|
+
- `GET /metrics`
|
|
366
|
+
- Prometheus-compatible
|
|
367
|
+
- `bilinc_` metric prefix
|
|
368
|
+
|
|
369
|
+
Examples of tracked areas:
|
|
370
|
+
|
|
371
|
+
- commit / recall / forget operation totals and latencies
|
|
372
|
+
- snapshot / diff / rollback totals and latencies
|
|
373
|
+
- auth failures
|
|
374
|
+
- rate limit hits
|
|
375
|
+
- backend errors
|
|
376
|
+
- readiness/liveness gauges
|
|
377
|
+
|
|
378
|
+
In-process observability is also available through the Python API.
|
|
379
|
+
|
|
380
|
+
## Storage Backends
|
|
381
|
+
|
|
382
|
+
### SQLite
|
|
383
|
+
|
|
384
|
+
Recommended for:
|
|
385
|
+
|
|
386
|
+
- local durable usage
|
|
387
|
+
- embedded deployments
|
|
388
|
+
- single-node setups
|
|
389
|
+
- controlled production environments
|
|
390
|
+
|
|
391
|
+
What exists today:
|
|
392
|
+
|
|
393
|
+
- persistent CLI support
|
|
394
|
+
- schema version tracking
|
|
395
|
+
- integration coverage
|
|
396
|
+
- rollback, snapshot, and diff support for durable state flows
|
|
397
|
+
|
|
398
|
+
### PostgreSQL
|
|
399
|
+
|
|
400
|
+
Recommended for:
|
|
401
|
+
|
|
402
|
+
- teams that want a database-backed deployment path
|
|
403
|
+
- environments where SQLite is not the right operational fit
|
|
404
|
+
|
|
405
|
+
What exists today:
|
|
406
|
+
|
|
407
|
+
- backend implementation in the repo
|
|
408
|
+
- contract-level integration tests
|
|
409
|
+
- CI validation with a PostgreSQL service job
|
|
410
|
+
|
|
411
|
+
Practical note:
|
|
412
|
+
|
|
413
|
+
PostgreSQL support is real and tested, but it is still a narrower path than the SQLite experience and should be treated with normal production caution.
|
|
414
|
+
|
|
415
|
+
## Testing, CI, and Validation
|
|
416
|
+
|
|
417
|
+
Bilinc’s repository includes:
|
|
418
|
+
|
|
419
|
+
- Python test matrix
|
|
420
|
+
- SQLite persistence coverage
|
|
421
|
+
- PostgreSQL integration coverage in CI
|
|
422
|
+
- package build validation
|
|
423
|
+
- wheel and sdist installation validation
|
|
424
|
+
- CLI persistence smoke checks in CI
|
|
425
|
+
- HTTP auth/rate-limit coverage
|
|
426
|
+
- observability coverage
|
|
427
|
+
|
|
428
|
+
If you are evaluating Bilinc seriously, the CI pipeline is part of the product contract.
|
|
429
|
+
|
|
430
|
+
## Documentation Map
|
|
431
|
+
|
|
432
|
+
- `docs/mcp-server.md`
|
|
433
|
+
MCP surface, transport notes, and tool reference
|
|
434
|
+
- `docs/security.md`
|
|
435
|
+
auth, validation, limits, and deployment trust model
|
|
436
|
+
- `docs/observability.md`
|
|
437
|
+
health model, readiness/liveness, and metrics
|
|
438
|
+
- `docs/runbook.md`
|
|
439
|
+
operator guidance and deployment notes
|
|
440
|
+
- `docs/release.md`
|
|
441
|
+
release and publish checklist
|
|
442
|
+
- `CHANGELOG.md`
|
|
443
|
+
shipped changes and release history
|
|
444
|
+
|
|
445
|
+
## Development and Local Setup
|
|
446
|
+
|
|
447
|
+
Clone the repo and install development dependencies:
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
git clone git@github.com:atakanelik34/Bilinc.git
|
|
451
|
+
cd Bilinc
|
|
452
|
+
python -m pip install -e '.[dev]'
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Run the full test suite:
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
PYTHONPATH=src pytest -q tests/
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Build distributable artifacts:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
python -m build
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Run a local persistence smoke:
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
bilinc --db ./tmp.db commit --key smoke_key --value hello
|
|
471
|
+
bilinc --db ./tmp.db recall --key smoke_key
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Run PostgreSQL integration tests locally if you have a database ready:
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
export BILINC_TEST_POSTGRES_DSN=postgresql://postgres:postgres@127.0.0.1:5432/bilinc_test
|
|
478
|
+
PYTHONPATH=src pytest -q tests/test_postgres_integration.py
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
## Roadmap
|
|
482
|
+
|
|
483
|
+
Near-term priorities:
|
|
484
|
+
|
|
485
|
+
- keep the shipped surface stable
|
|
486
|
+
- continue validating PostgreSQL deployments
|
|
487
|
+
- improve official integrations selectively
|
|
488
|
+
- tighten operator and release discipline further where needed
|
|
489
|
+
|
|
490
|
+
Possible future work:
|
|
491
|
+
|
|
492
|
+
- broader supported integrations
|
|
493
|
+
- hosted deployment model
|
|
494
|
+
- richer operator tooling
|
|
495
|
+
- stronger enterprise deployment paths
|
|
496
|
+
|
|
497
|
+
## License
|
|
498
|
+
|
|
499
|
+
[MIT](LICENSE)
|