Metadata-Version: 2.4
Name: llama-index-tools-swiss-truth
Version: 0.1.0
Summary: LlamaIndex tools for Swiss Truth — certified knowledge base for AI agents
Project-URL: Homepage, https://swisstruth.org
Project-URL: Documentation, https://swisstruth.org/docs/llamaindex
Project-URL: Repository, https://github.com/swiss-truth/swiss-truth-mcp
Project-URL: PyPI, https://pypi.org/project/swiss-truth-llamaindex
Author-email: Swiss Truth <hello@swisstruth.org>
Maintainer: swisstruth
License-Expression: MIT
Keywords: compliance,eu-ai-act,fact-checking,grounding,hallucination,hallucination-prevention,knowledge-base,mcp,rag,retriever,swiss-truth,verified-facts
Requires-Python: <4.0,>=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: llama-index-core<0.15,>=0.11.0
Requires-Dist: pydantic>=2
Description-Content-Type: text/markdown

# LlamaIndex Tools: Swiss Truth

Swiss Truth ToolSpec for LlamaIndex — certified knowledge base for AI agents.

Stop your LlamaIndex agents from hallucinating. Ground every response in **3,000+ certified facts** across **38 domains** in **10 languages**.

## Installation

```bash
pip install llama-index-tools-swiss-truth
```

## Usage

```python
from llama_index.tools.swiss_truth import SwissTruthToolSpec
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

spec = SwissTruthToolSpec()
tools = spec.to_tool_list()

agent = ReActAgent.from_tools(tools, llm=OpenAI(model="gpt-4o"), verbose=True)
response = agent.chat("Is health insurance mandatory in Switzerland?")
print(response)
```

## Available Tools

| Tool | Description |
|------|-------------|
| `search` | Search the certified knowledge base for verified facts |
| `verify` | Verify a factual claim (supported/contradicted/unknown) |
| `submit` | Submit a new claim for expert review |
| `list_domains` | List all 38+ available knowledge domains |
| `claim_status` | Get the verification status of a claim by UUID |
| `batch_verify` | Verify multiple claims in a single API call |
| `verify_response` | Fact-check an entire LLM response, get hallucination risk score |
| `find_contradictions` | Detect contradictions in a block of text |
| `get_compliance` | Get EU AI Act compliance attestation for a certified claim |

## No API Key Required

All public endpoints work without authentication. For higher rate limits:

```python
spec = SwissTruthToolSpec(api_key="your-key")
```

## Links

- 🌐 [Swiss Truth](https://swisstruth.org)
- 📖 [Documentation](https://swisstruth.org/docs/llamaindex)
- 🐍 [PyPI](https://pypi.org/project/swiss-truth-llamaindex)
- 🔗 [MCP Endpoint](https://swisstruth.org/mcp)
