Right now Aeglos only supports langchain on python. We will be adding to this very soon!


An API Key is required to use Aeglos. You can use fvs0kViMdL4I2J0ocvs8Sa010QzoA6eN4Q1FKj4R to trial Aeglos. To get a full licensed api key, please email us at team@aeglos.ai

Install the aeglos package


Import your necessary functions

Langchain Agents

Aeglos uses the guard function to invoke a new AgentExecutor from an Agent and an array of Tools. An example for this is shown below

llm = ChatOpenAI(model="gpt-4", temperature=0)
tools = [] # your tools here

agent = create_openai_functions_agent(llm, tools, prompt)
agent_executor=guard(agent = agent, tools = tools, api_key = 'xxxx')

You can use this agent_executor as you would regularly.

Langchain Chains

Aeglos uses the guard_chain function to guard chains. This function takes a chain in as input and returns a protected chain. An example of this is shown below.



As of now, Aeglos only supports LCEL chains . When joining these, make sure to guard_chain each individual chain in the final pipeline. An example of multiple chains being used is shown below.

Treat the output of the guard_chain function like a normal chain in all of your operations (whether batching queries,streaming, or performing asynchronous operations).