Skip to content

Commit d93b142

Browse files
authored
Update readme.md
1 parent 67ff2b8 commit d93b142

File tree

1 file changed

+83
-43
lines changed

1 file changed

+83
-43
lines changed
Lines changed: 83 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,61 @@
1-
CSV Analyzer Agent
2-
By Omar Salem & Luigi Saetta
1+
# CSV Analyzer Agent
32

4-
CSV Analyzer Agent is an AI-Agent assistant designed to automate document understanding and analysis.
5-
It intelligently routes user questions through a multi-step process that includes PDF information extraction, CSV data analysis, code generation, execution, and natural language explanation.
3+
CSV Analyzer Agent is an AI-Agent assistant designed to automate document understanding and analysis.
4+
It intelligently routes user questions through a multi-step process that includes PDF information extraction, CSV data analysis, code generation, execution, and natural language explanation.
65
It supports dynamic workflows like PDF parsing, CSV querying, and context-aware reporting through a Streamlit UI.
76

87
Reviewed: April 18, 2025
98

10-
1. Prepare Your Configuration
9+
---
1110

12-
☁️ OCI Generative AI Model (Cohere/Llama on OCI)
13-
Go to: OCI Console → Generative AI
11+
# When to use this asset?
1412

15-
Select a model like:
16-
meta.llama-3.3-70b-instruct
13+
Use this asset when you want to:
14+
- Parse and extract information from PDF documents
15+
- Ask questions about CSV files and receive data-backed answers
16+
- Automate code generation for data analysis
17+
- Get human-readable summaries of complex analytics
18+
- Demonstrate AI-powered multi-modal document analysis in action
1719

18-
Copy:
20+
Ideal for:
21+
- AI developers building document understanding tools
22+
- Oracle Cloud users integrating GenAI into document workflows
23+
- Data analysts exploring LLM + document orchestration using LangGraph
1924

20-
- model_id
21-
- compartment_id
22-
- endpoint (e.g., https://inference.generativeai.us-chicago-1.oci.oraclecloud.com)
25+
---
2326

24-
Paste them in `config.py`
27+
# How to use this asset?
28+
29+
This assistant can be launched via:
30+
- Streamlit UI
31+
32+
It supports:
33+
- CSV uploading and querying
34+
- PDF form parsing and field extraction
35+
- Secure Python code generation using OCI GenAI
36+
- Real-time execution and explanation of generated code
37+
- State-aware multi-turn conversation
38+
39+
## Setup Instructions
40+
41+
### OCI Generative AI Model (Cohere or LLaMA on OCI)
42+
43+
1. Go to: OCI Console → Generative AI
44+
2. Select a model like:
45+
`meta.llama-3.3-70b-instruct`
46+
3. Copy the following values:
47+
- model_id
48+
- compartment_id
49+
- endpoint (e.g., `https://inference.generativeai.us-chicago-1.oci.oraclecloud.com`)
50+
4. Paste them in `config.py`
2551

2652
Documentation:
27-
https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm
53+
[OCI Generative AI Documentation](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm)
2854

2955
No API key is required — authentication is handled via OCI identity.
3056

31-
Also ensure your **OCI CLI credentials** are correctly set up. Create or edit the following config file at `config`:
57+
Ensure your OCI CLI credentials are configured.
58+
Edit or create the following config file at `~/.oci/config`:
3259

3360
```
3461
[DEFAULT]
@@ -39,45 +66,58 @@ region=eu-frankfurt-1
3966
key_file=~/.oci/oci_api_key.pem
4067
```
4168

42-
2. Start the Chatbot
69+
### Start the Chatbot
4370

44-
Streamlit UI
71+
Streamlit UI:
72+
```bash
4573
streamlit run assistant_ui_langgraph.py
74+
```
4675

76+
You will see a full chat interface with support for uploading CSVs and PDFs, asking questions, and receiving answers backed by the AI Agent (`csv_analyzer_agent.py`).
4777

48-
You will see a full chat interface with support for uploading CSVs and PDFs, asking questions, and receiving answers backed by the AI Agent (csv_analyzer_agent.py).
49-
50-
3. Key Features
78+
## Key Features
5179

52-
Tool | Description
53-
------------------------|-------------
54-
CSV Upload | Load a CSV file and analyze it with questions
55-
PDF Extraction | Extracts structured fields like title, items, department, justification from uploaded PDFs
56-
Request Routing | Determines if user input relates to CSV or PDF
57-
Secure Code Generation | Uses OCI GenAI to generate Python code to analyze your data
58-
Security Check | Prevents execution of harmful code (e.g., delete, drop)
59-
Code Execution | Executes LLM-generated Python code safely in a sandboxed context
60-
Answer Generation | Summarizes execution results into a final natural language response
61-
State Management | Remembers chat history, extracted information, and uploaded files
62-
Sidebar Display | Shows PDF structured data and generated code for full transparency
80+
| Tool | Description |
81+
|--------------------------|-----------------------------------------------------------------------------|
82+
| CSV Upload | Load a CSV file and analyze it with questions |
83+
| PDF Extraction | Extracts structured fields like title, items, department, justification |
84+
| Request Routing | Determines if user input relates to CSV or PDF |
85+
| Secure Code Generation | Uses OCI GenAI to generate Python code to analyze your data |
86+
| Security Check | Prevents execution of harmful code (e.g., delete, drop) |
87+
| Code Execution | Executes LLM-generated Python code safely in a sandboxed context |
88+
| Answer Generation | Summarizes execution results into a final natural language response |
89+
| State Management | Remembers chat history, extracted information, and uploaded files |
90+
| Sidebar Display | Shows PDF structured data and generated code for full transparency |
6391

64-
4. Notes
92+
## Notes
6593

66-
- Supports both document inputs (CSV + PDF)
67-
- Uses LangGraph to orchestrate tool routing and execution
68-
- Modular design — individual tools can be expanded or replaced
69-
- Streamlit UI provides a fully interactive interface with visual progress and outputs
70-
- Built to run on Oracle Cloud Infrastructure with native LLM integration
94+
- Supports both document inputs (CSV + PDF)
95+
- Uses LangGraph to orchestrate tool routing and execution
96+
- Modular design — individual tools can be expanded or replaced
97+
- Streamlit UI provides a fully interactive interface with visual progress and outputs
98+
- Built to run on Oracle Cloud Infrastructure with native LLM integration
7199

72100
## Prompt Customization
73101

74102
All core prompts used by the agent are stored in `prompts.py`.
75103

76-
You can easily **modify or extend these prompts** to change how the agent performs routing, extraction, analysis, and natural language response generation.
104+
You can easily modify or extend these prompts to change how the agent performs routing, extraction, analysis, and natural language response generation.
105+
106+
The prompt for extraction can be found in `csv_analyzer_agent.py`.
107+
108+
---
109+
110+
# Useful Links (Optional)
111+
112+
- [OCI Generative AI](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm)
113+
Official documentation for Oracle Generative AI
114+
---
115+
116+
# License
117+
118+
Copyright (c) 2025 Oracle and/or its affiliates.
77119

78-
The prompt for extraction can be found in csv_analyzer_agent.py.
120+
Licensed under the Universal Permissive License (UPL), Version 1.0.
79121

80-
5. License
81-
Licensed under the MIT License.
82-
See `LICENSE` for details.
122+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
83123

0 commit comments

Comments
 (0)