Skip to content

From-scratch implementation of a ReAct agent using LangChain, showcasing manual control over tool invocation, prompt design, and reasoning loop without relying on built-in abstractions.

Notifications You must be signed in to change notification settings

muhammadhamzaazhar/ReAct-Agent-LangChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReAct Agent from Scratch using LangChain

This project is a minimal, transparent implementation of a ReAct (Reasoning and Acting) Agent built manually using the LangChain framework.

Instead of relying on high-level abstractions like initialize_agent, this repo walks through how a ReAct agent works under the hood — from formatting the prompt, invoking tools, to parsing LLM responses.


Features

  • Custom ReAct-style Prompt Template
  • Tool execution (e.g., get_text_length)
  • Manual ReAct-style reasoning/action loop
  • Intermediate step tracking (scratchpad)
  • Callback handler for logging LLM input/output

Note:

This project uses the mistralai/mistral-7b-instruct model hosted for free via OpenRouter. The model is accessed using the OpenAI-compatible API base

About

From-scratch implementation of a ReAct agent using LangChain, showcasing manual control over tool invocation, prompt design, and reasoning loop without relying on built-in abstractions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages