Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Knowledge Agent

Final course project (lab 9) for Laboratory Course of Machine Intelligence, Peking University, 2025 Fall.

An LLM-based interactive agent that models a learner’s understanding by adaptively probing topics from lecture materials through observation, planning, and reflection.

Implemented as a CLI tool that extracts topics from a lecture PDF, quizzes the user, reflects on answers, and tracks knowledge state. Supports topic number limiting and verbose mode with token usage.

Setup

  1. Python 3.12
  2. Install dependency:
pip install -r interactive_knowledge_agent/requirements.txt
  1. Set OpenAI key or call your API key later:
export OPENAI_API_KEY=<your_openai_api_key>

Usage

From repo root:

python interactive_knowledge_agent/main.py \
  --pdf interactive_knowledge_agent/pdf_materials/example.pdf \
  --prompt-dir interactive_knowledge_agent/prompts \
  --output-dir interactive_knowledge_agent/outputs \
  --model gpt-4o \
  --max-topics 3 \
  --verbose \
  --api-key "$OPENAI_API_KEY"

Flags

  • --pdf (required): path to lecture PDF.
  • --prompt-dir: prompt templates directory (default prompts).
  • --output-dir: where session JSONs are saved (default outputs).
  • --model: OpenAI chat model name (default gpt-4o).
  • --max-topics: keep only the first N topics from analysis.
  • --verbose: print topics, per-turn reflections, knowledge updates, and token usage.
  • --api-key: optional; otherwise uses OPENAI_API_KEY env.

About

Final course project for Laboratory Course of Machine Intelligence, Peking University, 2025 Fall.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages