Skip to content

ainfera-ai/examples-langchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

examples-langchain — Ainfera + LangChain

Working LangChain agent backed by Ainfera. ~30 lines. Clone, install, run.

Quickstart

git clone https://github.com/ainfera-ai/examples-langchain
cd examples-langchain
pip install -r requirements.txt
export AINFERA_API_KEY=ai_live_...  # https://app.ainfera.ai/signup
python main.py

What this shows

  • One Agent Card across providers (L1)
  • Drain-proof wallet — survives prompt injection (L3)
  • Audit URL printed after every call (L4)
  • Quality scored by Artificial Analysis per model

EU AI Act Annex IV ready — every call hash-chained, signed, exportable.

The whole change

LangChain speaks OpenAI's API. Two env vars and your existing ChatOpenAI code routes through Ainfera:

chat = ChatOpenAI(
    model="claude-opus-4-7",
    openai_api_key=os.environ["AINFERA_API_KEY"],
    openai_api_base="https://api.ainfera.ai/v1",
)

That's it.

Open the audit chain

After running, visit https://verify.ainfera.ai/agents/<your-agent-id> to see the hash-chained audit trail. Every call has a verifiable receipt.

Other frameworks

Apache 2.0. © Ainfera Inc. 2026.

About

Working LangChain agent backed by Ainfera (drain-proof wallet, signed audit). ~30 lines.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages