Metadata-Version: 2.4
Name: maximem-synap-llamaindex
Version: 0.2.3
Summary: Synap memory integration for LlamaIndex
Author: Synap Team
License-Expression: Apache-2.0
Keywords: synap,memory,llamaindex,rag,ai
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: maximem-synap>=0.7.1
Requires-Dist: maximem-synap-integrations-common>=0.3.1
Requires-Dist: llama-index-core>=0.10
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"

# maximem-synap-llamaindex

Synap memory for LlamaIndex: `SynapRetriever`, `SynapChatMemory` and `synap_st_chat_message`.

## Deeper scope ladders

On an account whose scope ladder has more levels than customer and user, pass the level as `scope_path`
(level key to value). It is sent with every fetch and every turn the object makes, and only when set.

```python
path = {"customer": "acme", "team": "payments", "user": "dana"}
retriever = SynapRetriever(sdk, user_id="dana", customer_id="acme", scope_path=path)
memory = SynapChatMemory(sdk, conversation_id=conv_id, user_id="dana", customer_id="acme", scope_path=path)
```

`maximem_synap.ScopeLadder.address(values)` builds `user_id`, `customer_id` and `scope_path` from level values.
Without `scope_path` nothing changes.

The server lets the path's `user` and `customer` values win over `user_id` / `customer_id`, so a `user_id` or `customer_id` that disagrees with the path raises `SynapIntegrationError` at construction, before any SDK call.

**Needs a newer SDK.** A path needs a `maximem-synap` release that has `get_scope_ladder` and `scope_path` on `fetch`, `send_message` and `record_message` (and `scope` on `memories.create`). With an older SDK, a turn that carries a path is dropped and an error is logged: it is never filed at a wider scope. Leave `scope_path` unset on an older SDK.
