AegisAI
LangChain

BaseTool subclass — drop into any agent.

Setup

pip install langchain langchain-openai httpx
export OPENAI_API_KEY=sk-...
export AEGISAI_USER_TOKEN=<JWT>

Copy aegisai_tool.py into your project. Use it like any other LangChain tool — ReAct, OpenAI Functions, structured-tool, LangGraph, all work.

Use it

from aegisai_tool import AegisAITool

tool = AegisAITool(
    base_url="https://api.aegisai.store",
    user_token=os.environ["AEGISAI_USER_TOKEN"],
    tenant_id="acme",
)
agent = create_react_agent(llm, [tool], prompt)
LlamaIndex

FunctionTool factory — same shape, different framework.

Setup

pip install llama-index llama-index-llms-openai httpx
export OPENAI_API_KEY=sk-...
export AEGISAI_USER_TOKEN=<JWT>

Copy aegisai_tool.py from samples/connectors/llamaindex/. Wraps the same POST /query endpoint behind a LlamaIndex FunctionTool.

Use it

from aegisai_tool import make_aegisai_tool

tool = make_aegisai_tool(
    base_url="https://api.aegisai.store",
    user_token=os.environ["AEGISAI_USER_TOKEN"],
    tenant_id="acme",
)
agent = ReActAgent.from_tools([tool], llm=llm)
If your service is multi-user

Mint a per-request tool, never share across users.

The tool class holds the user's JWT. If you build a web service where one process handles requests for multiple humans, instantiate the tool fresh per request — never cache it across users:

# inside your request handler
tool = AegisAITool(
    base_url=AEGIS_BASE,
    user_token=current_user.jwt,
    tenant_id=current_user.tenant_id,
)
agent = create_react_agent(llm, [tool], prompt)
result = agent.invoke({"input": user_message})

If you cache and reuse one tool across users, you'll cross-attribute the audit log — Alice's tool will report Bob's queries. AegisAI's row-level tenant policy will still block cross-tenant reads, but the audit chain becomes useless for incident response.

Building a custom Python agent?

If you're rolling your own framework — or wiring AegisAI into something exotic like Haystack, AutoGen, CrewAI, or your own — the same ~80-line shape works. Send us your platform and we'll PR a connector.

Email us