# How to Integrate Semantica AGI with Other Tools: MCP, REST API, and Framework Adapters

> Easily integrate Semantica AGI with other tools using its MCP server, REST API, and framework adapters. Connect with agent frameworks like OpenClaw and Agno seamlessly.

- Repository: [Semantica /semantica](https://github.com/semantica-agi/semantica)
- Tags: how-to-guide
- Published: 2026-08-13

---

**Semantica AGI exposes its 12 core knowledge graph tools through a Model-Context Protocol (MCP) server and a REST API, enabling seamless integration with agent frameworks like OpenClaw and Agno via configuration files and Python wrappers.**

Semantica AGI is architected for interoperability, providing standardized interfaces that allow external agents to consume its extraction, reasoning, and graph-query capabilities. The platform supports both protocol-based integration through MCP and traditional HTTP-based integration, alongside first-class adapters for popular agent frameworks.

## Integration Modes: MCP vs REST API

Semantica offers two primary integration pathways depending on your agent's capabilities:

- **MCP (Model-Context Protocol)** – The recommended approach generates a JSON configuration ([`mcporter.json`](https://github.com/semantica-agi/semantica/blob/main/mcporter.json)) that instructs agent gateways how to launch the Semantica MCP server and forward tool calls over `stdio` or `sse` transport. This is ideal for agents that natively understand MCP, such as OpenClaw or LangChain-MCP adapters.
- **REST API** – A conventional HTTP/JSON interface (default at `http://localhost:8000`) that wraps MCP functionality. The `OpenClawKGTool` class provides a lightweight Python wrapper for this endpoint, suitable for agents that cannot run MCP clients but can invoke HTTP endpoints.

## Integrating with OpenClaw

The OpenClaw integration ships in [`integrations/openclaw/mcp_tool.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/openclaw/mcp_tool.py) and exposes two primary classes for connecting Semantica to the OpenClaw gateway.

### MCP Configuration with OpenClawMCPConfig

The **`OpenClawMCPConfig`** class (lines 27-78 in [`integrations/openclaw/mcp_tool.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/openclaw/mcp_tool.py)) generates the [`mcporter.json`](https://github.com/semantica-agi/semantica/blob/main/mcporter.json) entry required to wire the Semantica MCP server into OpenClaw. This configuration tells the gateway how to launch the server and route tool calls.

To configure OpenClaw integration:

1. Start the MCP server:

```bash
python -m semantica.mcp_server

```

2. Generate the configuration:

```python
from integrations.openclaw import OpenClawMCPConfig

print(OpenClawMCPConfig().to_json())

```

3. Paste the output into `~/.openclaw/mcporter.json` and restart the gateway:

```bash
openclaw gateway restart

```

Once restarted, all 12 Semantica tools become native OpenClaw tools callable directly from running agents.

### REST API Wrapper with OpenClawKGTool

For agents that cannot use MCP, the **`OpenClawKGTool`** class (lines 86-254 in [`integrations/openclaw/mcp_tool.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/openclaw/mcp_tool.py)) provides a Python interface to the Semantica REST API. This wrapper exposes methods including `extract()`, `add_entity()`, `record_decision()`, and `get_causal_chain()`.

```python
from integrations.openclaw import OpenClawKGTool

# Connect to local Semantica REST server

kg = OpenClawKGTool(base_url="http://localhost:8000")

# Extract entities and relations

extraction = kg.extract("Alice visited the Eiffel Tower in Paris.")
print(extraction)  # {'entities': [...], 'relations': [...]}

# Add custom entities

kg.add_entity(label="Mars", entity_type="Planet")

# Query the knowledge graph

results = kg.query_graph("planet")

# Export as JSON-LD

jsonld = kg.export_graph(fmt="json-ld")

```

## Integrating with Agno

Semantica provides a first-class integration for the Agno framework in the `integrations/agno/` directory. These classes map Semantica's core pipelines onto Agno's `Toolkit` and `MemoryDb` abstractions, gracefully degrading when Agno is not installed to maintain optional dependencies.

### Key Agno Integration Classes

| Class | Role | Source File |
|-------|------|-------------|
| **`AgnoContextStore`** | Graph-backed memory store compatible with Agno's `MemoryDb` interface | [`integrations/agno/context_store.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/agno/context_store.py) |
| **`AgnoKnowledgeGraph`** | Relational `AgentKnowledge` with multi-hop GraphRAG capabilities | [`integrations/agno/knowledge_graph.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/agno/knowledge_graph.py) |
| **`AgnoDecisionKit`** | Exposes decision-intelligence tools as an Agno `Toolkit` | [`integrations/agno/decision_kit.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/agno/decision_kit.py) |
| **`AgnoKGToolkit`** | Provides KG-centric tools (`extract_entities`, `add_to_graph`, `query_graph`) as an Agno `Toolkit` (lines 55-464) | [`integrations/agno/kg_toolkit.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/agno/kg_toolkit.py) |
| **`AgnoSharedContext`** | Team-level shared `ContextGraph` with per-agent scoping | [`integrations/agno/shared_context.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/agno/shared_context.py) |

Install the integration using `pip install semantica[agno]`, then use the toolkit directly:

```python
from integrations.agno import AgnoKGToolkit
from agno.agent import Agent

# Create toolkit with default in-memory graph

kg_toolkit = AgnoKGToolkit()

# Attach to Agno agent

agent = Agent(tools=[kg_toolkit], show_tool_calls=True)

# Agent can now call Semantica functions:

# await agent.run_tool("extract_entities", {"text": "Bob lives in Berlin."})

# await agent.run_tool("query_graph", {"query": "location"})

```

## Direct Pipeline Integration

For use cases requiring no external agent framework, instantiate Semantica's pipeline directly using **`PipelineBuilder`** from [`semantica/pipeline/pipeline_builder.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/pipeline/pipeline_builder.py). This assembles the full AGI pipeline including parsers, extractors, reasoners, and graph storage.

```python
from semantica.pipeline.pipeline_builder import PipelineBuilder

# Build complete pipeline

pipeline = PipelineBuilder().build()

# Process document through full stack

result = pipeline.run("The quick brown fox jumps over the lazy dog.")

# Access populated knowledge graph

graph = pipeline.context.graph
print(graph.find_nodes())

```

## Core Architecture Components

Semantica's integration capabilities rely on several architectural pieces defined in the source:

- **[`semantica/mcp/server.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/mcp/server.py)** – Routes incoming MCP tool calls to underlying pipelines (extraction, reasoning, vector store operations).
- **[`semantica/vector_store/registry.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/vector_store/registry.py)** – Provides pluggable vector store backends including `faiss`, `pinecone`, `qdrant`, `pgvector`, `milvus`, `weaviate`, and `sqlite`.
- **[`semantica/server.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/server.py)** – HTTP/REST gateway exposing the same tool surface as the MCP server, used by `OpenClawKGTool` and external HTTP clients.
- **[`semantica/visualization/visualization_provenance.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/visualization/visualization_provenance.py)** – Optional provenance tracking for auditability across all integration modes.

All components share a common configuration model ([`semantica/config.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/config.py)) and centralized logging ([`semantica/utils/logging.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/utils/logging.py)), ensuring consistent behavior whether accessed via MCP, REST, or direct import.

## Summary

- **Semantica AGI** exposes 12 core tools through both **MCP** and **REST API** interfaces.
- **OpenClaw integration** offers `OpenClawMCPConfig` for protocol-based setup and `OpenClawKGTool` for HTTP-based access, both implemented in [`integrations/openclaw/mcp_tool.py`](https://github.com/semantica-agi/semantica/blob/main/integrations/openclaw/mcp_tool.py).
- **Agno integration** provides `AgnoKGToolkit` and related classes in `integrations/agno/` that map Semantica capabilities to Agno's `Toolkit` abstraction.
- Direct access is available via **`PipelineBuilder`** for custom implementations requiring no external framework.
- The **MCP server** ([`semantica/mcp/server.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/mcp/server.py)) and **REST server** ([`semantica/server.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/server.py)) share underlying pipelines for consistent behavior across integration modes.

## Frequently Asked Questions

### What is the difference between MCP and REST API integration in Semantica AGI?

MCP integration uses the Model-Context Protocol to stream tool calls over `stdio` or `sse` transport, requiring agents to speak the MCP protocol but offering better context management. The REST API wraps the same functionality behind HTTP endpoints at `http://localhost:8000`, making it accessible to any client capable of HTTP requests but without MCP's contextual streaming capabilities.

### How do I configure OpenClaw to recognize Semantica tools?

Import `OpenClawMCPConfig` from `integrations/openclaw`, call `to_json()` to generate the configuration snippet, and paste it into `~/.openclaw/mcporter.json`. After restarting the OpenClaw gateway with `openclaw gateway restart`, the Semantica MCP server will be available as a native tool provider.

### Can I use Semantica with Agno without installing Agno itself?

Yes. The integration classes in `integrations/agno/` are designed to gracefully degrade when Agno is not installed. They remain importable and functional for direct use, but cannot be passed to an Agno `Agent` until you install the optional dependency with `pip install semantica[agno]`.

### Which vector stores does Semantica support for integration backends?

According to [`semantica/vector_store/registry.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/vector_store/registry.py), Semantica supports pluggable backends including **FAISS**, **Pinecone**, **Qdrant**, **PGVector**, **Milvus**, **Weaviate**, and **SQLite**. This registry allows integrations to persist knowledge graph embeddings using your existing vector database infrastructure.